come recuperare i servizi su server remoti con powershell semplicemente
Getting the service on a remote server is easy
Get-Service -ComputerName Exch10
Getting a set of services on a remote machine isn’t difficult
Get-Service -ComputerName Exch10 -Name “MSExchangeAB”, “W32Time”, “W3SVC”
Ok so what about the scenario with multiple servers
Get-Service -ComputerName Exch10, server02
Multiple servers with a set of servers just means adding the –Name parameter and the list of services
Get-Service -ComputerName Exch10, server02 -Name “W32Time”, “W3SVC”
but you have to have the same list of services for each server.
Now lets get really picky and go for multiple servers where each one has a different set of services.
I thought about csv files but then how do you repent the list? Nested arrays – yuck.
I ended up with this approach. Its a bit messy but works and is easily expandable & changeable
$servers = “server02”, “exch10”
$server02_services = “BITS”, “NtFrs”, “MSMQ”, “Kdc”
$exch10_services = “MSExchangeAB”, “W32Time”, “W3SVC”
View original post 111 altre parole