C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
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.8
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.
People also reading
Membership not found