Skip Ribbon Commands Skip to main content

SharePoint Happenings

Help (new window)
Sign In
Navigate Up
Get Microsoft Silverlight
Install Silverlight plugin for a richer experience...
Blog Home |  Freeware |  Speaking |  About me

Updating Farm Administrators Group in SharePoint with Powershell



Bookmark and Share

Top Tech Links










Top SharePoint Administrator Links









Top SharePoint Developer Links













NOTE: This blog has been moved to http://blog.philwicklund.com. If you'd like assistance, leave a comment on the copied post in the new location (hint, use search on the right to find the post).


Below is a simple PowerShell script you can use to add a user or AD group to the Farm Administrators group in Central Administration. It's actually the same script you'd use to add a user into ANY SharePoint group, so it's helpful for more than just this one purpose:

 

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$CAPortNum = "12345"

$userOrGroup = "philsdevdomain\phil"

$site = new-Object Microsoft.SharePoint.SPSite("http://"+$env:COMPUTERNAME+":"+$CAPortNum)

$web = $site.RootWeb

$farmadmins = $web.SiteGroups["Farm Administrators"]

$farmadmins.AddUser($userOrGroup,"","","")

$web.Dispose()

$site.Dispose()