Avatar of kaygroth2
kaygroth2
Flag for United Kingdom of Great Britain and Northern Ireland asked on

How to handle: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

I'm working on a little utility in c# to grab data from a bunch of computers on a domain via WMI, i already have a section which find out if the machine is reachable and if it is then it uses WMI to gather the information from the machine.

However,sometimes i'm getting the below exception and im wondering how i should be handling it. The section where the WMI info is retrieved is already in a try catch block, but i want to be able to keep going if this exception occurs.

below is the exception in question:

Unhandled Exception: System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Management.ManagementScope.InitializeGuts(Object o)
   at System.Management.ManagementScope.Initialize()
   at System.Management.ManagementObjectSearcher.Initialize()
   at System.Management.ManagementObjectSearcher.Get()
   at Get_Computer_names.Program.Main(String[] args) in C:\Users\a_user\
Documents\Visual Studio 2010\Projects\program_name\program_name\Program.cs:line 77

Open in new window

.NET ProgrammingC#Programming

Avatar of undefined
Last Comment
kaygroth2

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
mastoo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
kaygroth2

ASKER
Thanks mastoo, makes sense, i'll give it a go on Monday :)
kaygroth2

ASKER
Clear and concise answer, Thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy