I am trying to stop and disable a service on a list of servers. I have the following script, but the problem is when the script gets to a server in the list which it can't connect to, it hangs up and does not continue with the rest of the servers. Any help greatly appreciated.
$servers = Get-Content c:\temp\servers.csv
Get-Service "ibm parity comm" -ComputerName $servers | Stop-Service
Get-Service "ibm parity comm" -ComputerName $servers | Set-Service -StartupType "Disabled"