Powershell: how to retreive service accounts from services for many servers

2015-05-11

Below a sample script``` $hosts = Get-Content “hosts.txt” foreach ($myhost in $hosts) { Get-WmiObject win32_service -ComputerName $myhost|where {$_.StartMode -eq “Auto”} | where {$_.StartName -like “*.*”} | foreach {write-host $myhost, $_.Startname} }


Enter your instance's address


More posts like this