473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C# ManagementScope E_ACCESSDENIED

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.
Jul 26 '07 #1
0 3907

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bart Simpson | last post by:
Hi, I'm testing to control Windows disk quota by PythonWin on win2003 and winXP. But ther is some problem.. This is the test code: import win32com.client
0
by: Natalia DeBow | last post by:
Hi there, I am trying to create shortcuts to a desktop and to a Start->Programs menu from a C# client talking to a server (using .NET Remoting) that in turn talks to a COM object. I am running...
0
by: Mitja Semolic | last post by:
Deploying ASP.NET web sites to Windows 2003 Server a Nightmare! You finished implementing a ASP.NET web site and then comes the really painful part, you have to deploy it. And to make things...
5
by: toupeira23 | last post by:
Hello I'm trying to connect to another server via WMI, and it works just fine. But everytime it first tries to connect with the current user credentials, which naturally don't exist on the...
0
by: upendra.desai | last post by:
Hi, I have written an application in Microsoft Visual C++ (Visual Studio 6.0) that uses MSXML 4.0 SP2. When I try to load an XML from a file, it throws an E_ACCESSDENIED (HRESULT = 0x80070005)...
1
by: moi | last post by:
Hello, I have make a Active Directory Membership to change the user password in the active directory with ASP.NET2 after a logo page, and it works fine. BUT i add this code when the password is...
1
by: kenshiro2000 | last post by:
Hi, On my development machine I have installed Visual Studio 2005 and I have developed a Web Services that exposes a COM (created in VB6) method. On this machine it is installed only the TLB and...
2
by: Spottswoode | last post by:
Hi I have developed a client/server application in C# that worked perfectly in my office but not so perfectly after deploying it to our client. A little information about the architecture first:...
0
by: federico | last post by:
Hello, is there a way to limit the time a "ManagementScope.Connect" execution takes to end before it times out by itself? I tried using ConnectionOptions.TimeOut property to no avail. I am...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.