SharePoint Power Shell : Remove/Delete users from User Information List
Script:
$url =
"http://sitecollection"
$web =
get-spweb $url
$list
= $web.Lists["User Information List"]
$listItems
= $list.Items
$listItemsTotal
= $listItems.Count
for
($x=$listItemsTotal-1;$x -ge 0; $x–-)
{
Write-Host(“DELETED:
” + $listItems[$x].name)
remove-spuser
$listItems[$x]["Account"] -web $url -confirm:$false
}
$web.dispose()
Url:
http://[localhost]/_catalogs/users/simple.aspx)
Comments
Post a Comment