Welcome‎ > ‎Scripting‎ > ‎

Find services running under credentials domain administrator account

posted Jul 17, 2013, 1:23 AM by Jurien Bosman   [ updated Jul 17, 2013, 1:24 AM ]
On many servers services are running under the domain administrator account.
To find out which services they are i wrote a little script. It checks all domain computers running Windows Server


$servers = get-qadcomputer | where { $_.OSName -match "Server"} | sort Name
foreach ($server in $servers) {
$hostname = $server.name
#Write-Host $hostname
if (Test-Connection -ComputerName $hostname -BufferSize 16 -Count 1 -ea 0 -quiet)
{
Write-Host $hostname -ForegroundColor blue
gwmi win32_service -computer $hostname | where {$_.StartName -eq "domain\administrator"} | select name
}
} 
Comments