Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GhislainL/250c00866ed043ecf855e2ce0d0043e2 to your computer and use it in GitHub Desktop.
Save GhislainL/250c00866ed043ecf855e2ce0d0043e2 to your computer and use it in GitHub Desktop.
$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)
$ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($contextWeb)
$UserProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext)
$Profiles = $UserProfileManager.GetEnumerator();
foreach ($oUser in $Profiles ) {
if ($oUser.item("SPS-PersonalSiteCapabilities").Value -eq 14 ){
$personalurl = $url + $oUser.item("personalspace").Value
Write-Host $oUser.item("AccountName").Value
Update-SPRepopulateMicroblogFeedCache -ProfileServiceApplicationProxy $proxy -accountname $oUser.item("AccountName").Value
}
}
$contextWeb.Dispose()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment