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.
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
-
2Another more "powershell'is" way to find CA
Get-SPWebApplication -IncludeCentralAdministration | ? IsAdministrationWebApplication
– Anders Rask Apr 10 '14 at 8:23
Alternatively to PowerShell, SharePoint Timer Service runs under farm account. Check it out and you get farm account
-
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 '15 at 9:28 -
1You 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 '18 at 8:03
This is what I used to change the farm account
Get-SPManagedAccount
New-SPManagedAccount
Remove-SPManagedAccount
Set-SPManagedAccount
-
Can you please add more details regarding what parameters to pass – Robert Lindgren Apr 10 '14 at 8:39
To change the farm account you need to use stsadm, still.
stsadm –o updatefarmcredentials –userlogin DOMAIN\username –password password
-
2