SharePoint Saturday Washington DC – 2013

Last Saturday, on December 7th, I presented at the SharePoint Saturday DC​ 2013. This was my first time speaking at SharePoint Saturday event in USA.
sharepointsatdc.png
I presented a session in the IT PRO track on Crawling your SharePoint 2010 sites with SharePoint 2013 Search using Cross farm services. The event was very well organized and I met so many known faces.
I would like to thank everyone who attended my session. Please find my presentation slides below.
Kudos to all the organizers, sponsors and volunteers for successful event!!!

How to Unfollow all the sites with powershell script at sharepoint 2013

​If you are looking to script the unfollowing of the sites in SP 2013 then you can use the following PowerShell. You can loop through users to execute the following code. For this sample I have hard coded User Name and Site URL.

$userName = "Contoso\brianc" 

$site = Get-SPSite "http://intranet.contoso.com"

$serviceContext = Get-SPServiceContext($site)

$profileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)

if($profileManager.UserExists($userName))
{
     $userProfile = $profileManager.GetUserProfile($userName)
    
     $followingManager = new-object Microsoft.Office.Server.Social.SPSocialFollowingManager($userProfile, $serviceContext)
     
     $followed = $followingManager.GetFollowed("Sites")
     
    $actorInfo = new-object Microsoft.Office.Server.Social.SPSocialActorInfo
    
     foreach($site in $followed)
    {        
        $actorInfo.ContentUri = $site.Uri
        $actorInfo.AccountName = $userProfile.AccountName
        $actorInfo.ActorType = "Site"
        $followingManager.StopFollowing($actorInfo)
    }

}​