If I send this two-liner to Powershell
$sName = "ALG" $service = Get-Service -computername db-name -Name $sName
I will get back information about that service on that computer. If I change the name to "db-nameXXX" (bogus name) I will get an error that the service is not found. However, I have a server that stops accepting remote-desktop sessions (I also can't connect with MS SQL Manaagement studio) and sending these commands to that machine (when in an error condition) just hangs... The script runs but never returns. I would like to have a 'time out' functionality so that at a certain point, I can output a message saying the machine is not responding. Right now, the script is not letting me do anything. I tried a start/process/end block, but as long as get-service does not come back with an error, I can't get anywhere.