troubleshooting Question

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

Avatar of kaygroth2
kaygroth2Flag for United Kingdom of Great Britain and Northern Ireland asked on
Programming.NET ProgrammingC#
3 Comments1 Solution5743 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
mastoo

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros