How to Make Users Follow a Certain User in SharePoint 2013 using SSOM Powershell

Introduction 
 
The following script will help make everyone in the user profile follow a single user. We sometimes receive requests from clients where they want a certain account to be followed by everyone. In that case, the below script will be very helpful.
 
  1. Add-PSSnapin microsoft.sharepoint.powershell -EA SilentlyContinue    
  2.     
  3. $site = Get-SPSite "any site collection url"    
  4.     
  5. $serviceContext = Get-SPServiceContext($site)    
  6.   
  7. # Represents a collection of UserProfile objects that are used to access user profile data.     
  8.     
  9. $profileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext)     
  10.     
  11. $profiles = $profileManager.GetEnumerator()    
  12.     
  13. foreach ($profile in $profiles)    
  14. {    
  15.     
  16.     Write-Host $Profile.AccountName "|" $Profile.DisplayName;    
  17.   
  18.     #Initializes a new SPSocialFollowingManager instance for the specified user and service context.    
  19.     
  20.     $followingManager = New-Object Microsoft.Office.Server.Social.SPSocialFollowingManager($profile, $serviceContext)     
  21.        
  22.        
  23.     # Create a new social actor object for the User to follow    
  24.     
  25.     $socialActor = New-Object Microsoft.Office.Server.Social.SPSocialActorInfo    
  26.     
  27.     $socialActor.AccountName = "Domain\username" # Provide the user account details which should be followed by everyone    
  28.     
  29.     $socialActor.ActorType = [Microsoft.Office.Server.Social.SPSocialActorType]:: User    
  30.     
  31.     $followingManager.Follow($socialActor)    
  32.     
  33.     
  34. }    
Once the script is run, you can verify for any user in the user profile by navigating to the MySite of the user. The URL for any user's MySite would look like https://mysite web app/personal(managed path set while creating user profile)/ID of the User -> NewsFeed -> Click on the number of the user you are following (19 in below screenshot) and you can see the user in the page you are redirected to.
 
 
 
Thank you! Please post your queries in case of any issue,
 Saurav