I have a script that pings a machine, if sucessful it will the check to see if a user is logged on and return there username, it will also connect to AD and resolve the username to a friendly username, it also checks to see if a service is running.
The script works great however there are a few machines that i get the error message:
"the remote server machine does not exist or is unabailable: 'GetObject' "
i have found that this is due to the rpc service not started on the machine as i can not even run on to the admin shares of the computer
Is there a way of trapping this error so it just echo's back "RPC service is not running on machine x and then quit rather than the windows script host error message?
below is the first part of the code to prompt for the machine LRQxxxxx
and Set objWMIService = GetObject("winmgmts:" _ is the line it keeps crashing out on. I have tried to put some error handling but that does not work, is there another way or a better way to check?