Hello,
I have to monitor a remote server for functions such as CPU
Utilization etc. I am using System.Management namespace for the same.
But when I try to execute the following code, it gives
System.UnauthorizedAccessException though the user which I have provided is a
valid domain user having administratice rights on that computer.
Code:
//Build an options object for the connection
ConnectionOptions options = new ConnectionOptions();
options.Username = "User1";
options.Password = "MyPassword";
//Make a connection to a remote computer using these options
ManagementScope scope = new ManagementScope("\\\\Server1\\root\\cimv2",
options);
scope.Connect();
Can any one help me out for this?
Thanks,
Sushi