المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : WMI Uninstall application on remote computer (The RPC server is unavailable. (Exception from HRESULT: 0x800706BA))



C# Programming
12-08-2009, 07:30 PM
Ok so I am having a big problem with this. I had a problem with getting a remote servers serices to stop with WMI and ended up using a ServiceController instead (worked great).

I created a application that got all computer objects from AD. When you click on those computer objects it gets information such as services (and their state), installed applications, disk drives, and other information such a manufacturer, model, etc.. All of this works perfect!

The problem is I can't uninstall software. If I use the same credentials as I do getting the information I get an 'Access Denied' Error


ConnectionOptions conn = new ConnectionOptions();
conn.Impersonation = ImpersonationLevel.Impersonate;
conn.EnablePrivileges = true;


But if I do this I no longer get the access denied error and get the RPC server is unavailable:


ConnectionOptions conn = new ConnectionOptions();
conn.Authentication = AuthenticationLevel.Default;
conn.Impersonation = ImpersonationLevel.Impersonate;
conn.Username = "DOMAIN\USERNAME";
conn.Password = "PASSWORD";
conn.Authority = null;
conn.EnablePrivileges = true;


So how come I no longer get the access denied error and get something abouit the RPC server is not avaiable? How is this since the RPC service IS available since I just got tons of information from it!

Also if you are suggesting I try this instead of DOMAIN\USERNAME:

conn.Authority = "ntlmdomain:DOMAIN";

it doesn't work. When I do it that way it still gives me a access denied error.

I noticed someone else seemed to have this issue:
http://www.codeproject.com/Messages/2903205/WMI.aspx[^ (http://www.codeproject.com/Messages/2903205/WMI.aspx)] but it was never resolved it looks like.

I have googled the crap out of this error message and tried everything that I found suggested (changing the AuthenticationLevel, changing the ImpersonationLevel) and it didn't work for me http://www.barakasoft.com/script/Forums/Images/smiley_frown.gif