Skip the RPC Server is unavailable error RRS feed

  • Question

  • Hello everyone. 

    I am using get-wmiobject from my ADComputer.

    Some of the PCs which are not online, are giving me this error message "get-wmiobject : The RPC server is unavailable".

    Is there anyway, I can tell in my script that skip this error: "get-wmiobject : The RPC server is unavailable". And show me only which is available?

    Thanks again.

    Wednesday, April 22, 2020 3:46 PM

All replies

  • Help test-connection -online


    Wednesday, April 22, 2020 7:19 PM
  • Is there any other way, because this thing taking more time in execution?


    Wednesday, April 22, 2020 9:07 PM
  • Have you looked at the parameters available on the Test-Connection cmdlet? Do you see the -Timeout parameter? And the -Quiet parameter?

    If Test-Connection fails, don't try the Get-WMIObject!

    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Wednesday, April 22, 2020 9:40 PM
  • Is there any other way, because this thing taking more time in execution?


    Did you read the whole link and examine the examples?

    Without some basic knowledge about computers and networking you may niot be able to understand teh instructions given.  Perhaps you should ask a co-worker or others to help you.


    Wednesday, April 22, 2020 10:02 PM
  • Honestly speaking. I did try this a month ago, it did work but was taking too much time. Since you both are telling me the same solution. I will follow the same path and search more in this direction, and I am sure I will find the right solution.

    Thanks again

    Thursday, April 23, 2020 1:14 AM
  • Why is this an issue.  Just test the connection.  If it is false then don't execute the WMI command.

    Start by learning some basic computer networking and PowerShell.  The rest will become clear.

    Start with this free book: https://www.sapien.com/books_training/Windows-PowerShell-4 


    Thursday, April 23, 2020 1:34 AM
  • Thanks for the link of the book. 
    Thursday, April 23, 2020 1:37 PM