Skip to content

Script to clear User Information List

January 11, 2013

A simple SharePoint PowerShell script to clear the user information list, just keep in mind that doing so, you will lose all users credentials previously set.

$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()

Advertisements

From → SharePoint 2010

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: