Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Continuing PowerShell Script when unable to connect to server

$
0
0

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"


Viewing all articles
Browse latest Browse all 6937

Trending Articles