$site = Get-SPSite "http://mySiteCollection/"
$serviceContext = Get-SPServiceContext($site)
$profileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)
foreach($userProfile in $profileManager.GetEnumerator())
{
$followingManager = new-object Microsoft.Office.Server.Social.SPSocialFollowingManager($userProfile, $serviceContext)
$followed = $followingManager.GetFollowed("Users")
$actorInfo = new-object Microsoft.Office.Server.Social.SPSocialActorInfo
foreach($user in $followed)
{
write-host $userProfile.AccountName 'follows' $user.AccountName
$actorInfo.AccountName = $user.AccountName
$actorInfo.ActorType = "User"
$followingManager.StopFollowing($actorInfo)
}
}
Tuesday, February 9, 2016
SharePoint 2013 PowerShell - Everyone Unfollow Everyone
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment