Test running Services on domain controllers

##
## Test services
##
#$session = New-PSSession -ComputerName ‘server02’, ‘server03’ bla bla bla
$session = New-PSSession -ComputerName ‘<servername>’

‘DFSR’, ‘NtFrs’, ‘Kdc’, ‘W32Time’, ‘ADWS’, ‘DNS’, ‘EventLog’, ‘gpsvc’, ‘Netlogon’, ‘NTDS’, ‘wuauserv’ |
foreach -BEGIN {
$sb = {
param($service)
Get-Service -Name $service
}
} -PROCESS {
Invoke-Command -Session $session -ScriptBlock $sb -ArgumentList $psitem
}

$session | Remove-PSSession

Leave a Reply

Your email address will not be published. Required fields are marked *