Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can I get the name of the Farm account ? I can see it listed in Get-SPManagedAccount, but do not see any properties on the SPManagedAccount objects to be able to dynamically filter by and determine if it's the farm administrator.

share|improve this question

3 Answers

up vote 4 down vote accepted

Use (Get-SPFarm).DefaultServiceAccount.Name should give you the Farm Account

share|improve this answer
seems to work - thanks! – David Martines Apr 20 '12 at 13:46

This will give you the Farm Administrators:

$ca = [Microsoft.SharePoint.Administration.SPWebService]::AdministrationService.WebApplications | Select -First 1
$root = $ca.Sites["/"].RootWeb
$grp = $root.SiteGroups["Farm Administrators"]
$grp.Users

and

Get-SPManagedAccount will give you managed accounts

There should only be the farm admin common in these two groups

share|improve this answer

this is what i used to change the farm account Get-SPManagedAccount

New-SPManagedAccount

Remove-SPManagedAccount

Set-SPManagedAccount

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.