C# ManagementScope E_ACCESSDENIED

G

Guest

i'm working with WMI and trying to collect a remote machine network shares.

i recalled that this did work. but maybe a MS hotfix put an end to this. i
cannot seem to get the remote machine data because of "accessdenied" error.
i'm not sure what permissions, rights or policy i need to look at..

here is part of my code...
public string[] getRemoteshares(string remotesystem)
{
//connecting to the remote computer being specified by the main
form
ConnectionOptions options = new ConnectionOptions();
options.Username = "administrator";
options.Password = "password";
//options.Authority = "ntdlmdomain:cs";
options.Impersonation =
System.Management.ImpersonationLevel.Impersonate;
options.EnablePrivileges = true;
options.Authentication =
System.Management.AuthenticationLevel.Default;
ManagementScope scope = new ManagementScope("\\\\" +
remotesystem + "\\root\\cimv2", options);
scope.Connect();

====
i'm passing the remote machine name. of course if i do this locally it works.

there is alot of write up on the internet but not answer that i can find.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top