WMI

  • Thread starter Thread starter Jonas Nilsson
  • Start date Start date
J

Jonas Nilsson

Im trying to read information about clients though a web application. (
Clientdatabase ).

I connect like this, and my user account have permissions to access all
klients in the network.

ManagementObjectSearcher query;
ManagementObjectCollection queryCollection;
System.Management.ObjectQuery oq;
string stringMachineName = "clientName";
ConnectionOptions co = new ConnectionOptions();
co.Username = "";
co.Password = "";
System.Management.ManagementScope ms = new
System.Management.ManagementScope("\\\\" + stringMachineName +
"\\root\\cimv2", co);

But i get an error, because the web app is running as the account "ASP.NET",
"ASP.NET is not authorized to access the requested resource"

How can i get the web app to run as my "client accout".
I have removed the Anonymous login from IIS, and added impersonate="true",
authentication mode="Windows" to web.config.

/Jonas
 
Back
Top