SharePoint - How Delete all List Items using PowerShell

SharePoint - How Delete all List Items using PowerShell

In Large SharePoint lists sometimes we need to clear (delete) all list items. The following script will do this task.

$site=Get-SPSite "URL"
		
$web=$site.RootWeb
		
$list=$web.Lists["List Title"]
		
while (

$list.Items.Count -gt 0){$list.Items[0].Delete();

Write-host("Remaining "+$list.Items.Count+ " Itens";


}


要查看或添加评论,请登录

Edvaldo Barbosa Guimar?es Filho的更多文章

社区洞察

其他会员也浏览了