Delete Items from a SharePoint List using PowerShell

Delete Items from a SharePoint List using PowerShell
InfoPath alternatives for form designing SharePoint

In this post we will discuss how we can delete list items using PowerShell in SharePoint 2013. You can also check:
– Get Size of sub sites PowerShell Script SharePoint 2013 or 2007

– How to cancel all workflows having Suspended state in SharePoint 2013?

– Merge-SPLogFile in SharePoint 2010

Below is the PowerShell script. Open SharePoint 2013 Management Shell and run below PowerShell command.

I have a list name as “MyTestList99” which has below items. I want to delete all items using PowerShell.

Delete Items from a SharePoint List using PowerShell
Delete Items from a SharePoint List using PowerShell

$web = Get-SPweb “http://win-pfcp2dgt8di/sites/EnjoySharePoint/”

$list = $web.Lists[“MyTestList99”]

$items = $list.items

foreach ($item in $items)

{
$deleteitem=$list.GetItemById($item.ID)

$deleteitem.Delete()

}

After running above command, if you will refresh the list, you will not get any item in the list.

Delete Items from a SharePoint List using PowerShell
Delete Items from a SharePoint List using PowerShell

Hope this will be helpful.

Similar SharePoint 2013 Tutorials

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →

Leave a Reply