Accounts used by Application Pools or Service Identities are in the Local Machine Administrators Group
[Applies to SharePoint 2016; not tested on other versions of SharePoint]
Sometimes you see this false error on Health Analyzer saying that "Account used by application pools or service identities are in the local machine Administrators group":
You have confirmed that the reported servers for the “Failing Servers” don’t have the farm account in their local admins group. Script to verify:
Foreach($server in (Get-SPServer| ? {$_.Role-NE "Invalid"}))
{
$server = $server.ToString().TrimStart("SPServer Name=")
Invoke-Command -ComputerName $server {
Get-LocalGroupMember -Group Administrators
} | select ObjectClass, Name, PrincipalSource, PSComputerName | sort -Property PSComputerName | ft -GroupBy PSComputerName
}
And yet, hitting the “Reanalyze Now” button does not clear out the error.
Diagnosis
The Health Analyzer does not “see” the absence of the farm account in the local admins group until the reported server’s SharePoint Timer Service (SPTimerV4) is recycled. SPTimerV4 is scheduled to be recycled once a day at 0600, but sometimes it fails due to other running services preventing it from recycling. If the error is present after 0610, check for the failure of the “Timer Service Recycle” job on the Job History page. Direct URL: https://caUrl/_admin/TimerJobHistory.aspx?View=<num>
Remedy
Go to the reported server and restart the SharePoint Timer Service by running “Restart-Service SPTimerV4” in PowerShell or select Restart from the Services console:
Once restarted, click “Reanalyze Now” to confirm: