Asked by:
Getting 'RPC Server unavailable error' on using WMI to access Remote Server

Question
-
I know this has been posted hundreds of times but I can't find a solution to my problem.
I am trying to access Information like Disk space, Processes running etc from a remote server running Windows Server 2003
(sp1) from a Windows XP(sp2) client. I am getting a 'RPC Server unavailable. HRESULT: 0x800706BA' error.
This is my code:
ConnectionOptions options = new ConnectionOptions();
options.Username = "Username";
options.Password = "Password";
options.Authority = "ntdldomain: Domain";
ManagementScope scope = new ManagementScope("\\\\serverIP\\root\\cimv2", options);
scope.Connect();//Query system for Operating System information
//actions I Perform
Here is the exception details:
System.Runtime.InteropServices.COMException was unhandled
Message="The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
Source="mscorlib"
ErrorCode=-2147023174
StackTrace:
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.ManagementScope.Connect()
at WMI.Program.Main(String[] args) in D:\MySolutions\WMI\WMI\Program.cs:line 18
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()These are the actions I performed:
1. I am the administrator in my local machine. The account that I use to login has administrative previleges in the
target machine.
2. Firewall setting in the Target Server has been enabled to allow Remote Calls using netsh firewall set service
RemoteAdmin enable.
3.RPC services are running in the target machine.
a. Remote Procedure Call (RPC)
b. Remote Procedure Call (RPC) Locator4. Set PagedPoolSize to 0 at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
5. I can ping the server from my local machine.
Can anybody provide more information about this error?Tuesday, December 11, 2007 11:22 AM
All replies
-
Maybe try posting in a scripting forum as this one is for Exchange Server, however you can try the tool RPCping (from Microsoft, free) as well as check and make sure remote registry is running on the target server.Tuesday, December 11, 2007 4:41 PM
-
Have u got the solution. I am facing the same problem. Please let me knowMonday, May 12, 2008 1:03 PM
-
- Proposed as answer by Senior System Engineer Sunday, September 18, 2011 11:55 PM
Thursday, May 29, 2008 12:13 PM -
I'm getting the same error in the same scenario. I first enabled remote admin on the remote computer Windows firewall, then turned OFF Windows firewall. Then checked and made sure RPC service was running on remote machine. Then replaced hostname with IP address in script. What could be the prob?Wednesday, November 26, 2008 3:30 PM
-
Microsoft.
- Proposed as answer by RAurelian Thursday, February 28, 2013 12:43 PM
Wednesday, February 18, 2009 6:50 AM -
I am having the same problem as described in te starter topic, so I hope this will give it a boost.
I have been googling this like crazy for 2 days, but to no avail.
In addition to what was already mentioned above I have checked:
- My DNS settings
- My protocols
-Turned off virusscanner
- Added the following lines of code:
options.EnablePrivileges = true;
options.Authentication = AuthenticationLevel.PacketPrivacy;
options.Impersonation = ImpersonationLevel.Impersonate;- Turned on remote connections on the target,
-Checked the DCOM settings on both target as server.
Still no solution... how can this issue be around for 3 years without a solution for it to be found?
(Please do not say "Microsoft" again ;)
- Proposed as answer by Senior System Engineer Sunday, September 18, 2011 11:55 PM
Friday, December 10, 2010 12:16 PM -
Hi,
Is there any firewall between the servers? Usually RPC Server Unavailable is due to DNS Problems or firewall problems. And I had a lot of trouble until I could set my forefront TMG to allow this RPC traffic. It's not as simple as allow,all,all,rpc.
Thursday, December 23, 2010 11:19 AM -
Hi,
What I found that RPC uses the below ports and RPC Dynamic Port Allocation will instruct a program to use a dynamic port above 1024-65535
open the high end ports between 1024 - 65535 and see the results.
Service Name
UDP
TCP
HTTP
80, 443, 593
80, 443, 593
Named Pipes
445
445
RPC Endpoint Mapper
135
135
RPC Server Program
Dynamically Assigned
Dynamically Assigned
Tuesday, April 19, 2011 5:35 PM -
I was experiencing the error listed since installing SQL Server 2008, and still experienced it after upgrading to 2008 R2. I was getting the error when trying to connect to Reporting Services via SSMS from my local PC. The error occurred on the test server but not the production server. All configuration settings for SQL Server matched for both servers and all required services were running. The error was finally isolated to a Windows Firewall Inbound Rule setting: The "Windows Management Instrumentation (WMI-In)" rule was enabled in production but not test. Enabling it in test resolved the error and allowed me to connect from my PC to Reporting Services.
- Proposed as answer by Daniel Colbert Friday, September 23, 2011 1:07 PM
Tuesday, May 31, 2011 2:47 PM -
hi
try to connect to machine using Wbemtest tool.Type on Cmd promt wbemtest and hit enter you will get Gui base wmi tool there click on Connect and provide all the details if you able to connect to the machine from then wmi you can access if you not able to connect you will see exact reasone for error.give access to scom agent account on that machine or reboot the machine and rebuild the WMI.And for testing disable the firewall on that machine and then try to connect if you able to connect then you need to open disired port on that machine.
Omkar umarani SCOM STUDENTWednesday, September 14, 2011 9:01 AM -
The problem is this line.
options.Authority = "ntdldomain: Domain";
Change it to this one:
options.Authority = "ntlmdomain: Domain";- Edited by Episuarez Tuesday, April 24, 2012 12:30 PM
Tuesday, April 24, 2012 12:30 PM -
I had the same problem and was very puzzled because all of my settings were correct (Firewall, DCOM, credentials etc.)
I monitored my security event log on the target server and ran another test of my remote wmi function, 2 events were reported noting bad username or password. I know that the credentials are correct so I check the time on both servers.
The problem for me ended up being a time difference of several hours between the source and target servers. Check that the time is consistent between the two servers and try again
- Proposed as answer by zambiniman15 Tuesday, November 3, 2015 11:07 PM
Saturday, November 2, 2013 4:19 PM -
Thank you very much my issue got resolved after synchronizing the time between the servers
- Proposed as answer by zambiniman15 Tuesday, November 3, 2015 11:07 PM
- Unproposed as answer by zambiniman15 Tuesday, November 3, 2015 11:07 PM
Monday, January 13, 2014 11:33 AM