Skip to content

Instantly share code, notes, and snippets.

$UserProfileServiceName = "UPS"
$url = "https://sitecollection"
$proxy = Get-SPServiceApplicationProxy | ? {$_.Name -eq $UserProfileServiceName}
Update-SPRepopulateMicroblogLMTCache -ProfileServiceApplicationProxy $proxy
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")
$contextWeb = New-Object Microsoft.SharePoint.SPSite($url)