12

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.

5 Answers 5

25

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

0
7

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

1
  • 3
    Another more "powershell'is" way to find CA Get-SPWebApplication -IncludeCentralAdministration | ? IsAdministrationWebApplication Apr 10, 2014 at 8:23
0

Alternatively to PowerShell, SharePoint Timer Service runs under farm account. Check it out and you get farm account

2
  • Do you have some steps to check SharePoint Timer Service, if so can you please share it as part of an answer.
    – Asad Refai
    Aug 19, 2015 at 9:28
  • 1
    You can get the account for the SharePoint Timer Service as well using PowerShell, namely via WMI (as Get-Service does not provide this info, see: blogs.technet.microsoft.com/heyscriptingguy/2012/02/15/…): (Get-WmiObject Win32_Service | ? { $_.Name -eq 'SPTimerV4' }).StartName
    – pholpar
    Aug 2, 2018 at 8:03
-1

To change the farm account you need to use stsadm, still.

stsadm –o updatefarmcredentials –userlogin DOMAIN\username –password password

1
  • 2
    The question is not about how to change farm account Nov 18, 2014 at 15:46
-2

This is what I used to change the farm account

Get-SPManagedAccount

New-SPManagedAccount

Remove-SPManagedAccount

Set-SPManagedAccount
1
  • Can you please add more details regarding what parameters to pass Apr 10, 2014 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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