C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
PowerShell Script To Delete All Items Of SharePoint 2013
WhatsApp
Gowtham Rajamanickam
8y
16.7
k
0
0
25
Blog
Steps
Open your SharePoint Management Shell.
Copy the code given below and paste it.
Run the code given below.
Open your SharePoint site
Check if the execution completed successfully or not.
Code
$siteURL =
"https://gowtham.sharepoint.com/tutorial"
$ListName=
"Tutorials"
$site =
new
-
object
Microsoft.SharePoint.SPSite ($siteURL)
$web = $site.OpenWeb()
$oList = $web.Lists[$ListName];
$collListItems = $oList.Items;
$count = $collListItems.Count -1;
for
($intIndex = $count; $intIndex -ge 0; $intIndex--)
{
$collListItems[$intIndex].Delete();
}
Thanks for reading the blog.
PowerShell
SharePoint 2013
Recommended related topics
Membership not found