After you setup SharePoint application and "My Site" then start to import user profile, you might need to cleanup information that was imported or prevent certain properties from being displayed anywhere in your application. This would happen in a scenario where the customer figures out that the information that was stored in and imported from active directory is not updated and you want to avoid displaying incorrect information across your application.
To make sure that such user information are not displayed across the site after being imported, you need to notice that this information is regularly updated and cached in multiple places in SharePoint. Basically...
Avoid indexing specific properties
After you configure the properties…
#URL$mySiteUrl = "http://sharepoint:77/"$site = Get-SPSite $mySiteUrl$context = Get-SPServiceContext $site$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)$profiles = $profileManager.GetEnumerator()foreach ($userProfile in $profiles) {#Get user profile and change the value $userProfile["title"].Value = "" $userProfile["SPS-JobTitle"].Value = "" $userProfile.Commit()}
Removing cached user information from User information list
Some information will be cached in the user information list: “/_catalogs/users/simple.aspx", you need to make sure that information in this list does not hold reference to the user properties that you wish to clean up. Perform the following steps...
$url = "http://SharePointSite/"$site = Get-SPSite $url$list = $site.OpenWeb().SIteUserInfoListWrite-Host "Total Items:" + $list.items.countforeach( $item in $list.items){ if( $item["Job Title"] )
{ write-host $item["Job Title"]; $item["Job Title"] = ""; write-host $item["Job Title"]; $item.Update() }
}$list.Update()
Excellent article..added to fav..