D
Dan Pavel
Hi,
I am trying to list in a web page the processes an the services of a
computer in my workgroup. For my computer I use the windows user and it
works fine. For the remote computer I use admin user and password
entered by text boxes and saved as cookie. The bad part is that I get
"Access denied". The ASPNET user is in Administrators group on my
computer.
ConnectionOptions con = new ConnectionOptions();
if (Request.Cookies["wmiuser"].Value.ToString() != "")
{
con.Username = Request.Cookies["wuser"].Value.ToString();
con.Password = Request.Cookies["wpass"].Value.ToString();
}
ManagementScope ms = new ManagementScope("\\\\" + computer +
"\\root\\cimv2", con);
ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Service");
ManagementObjectSearcher query = new ManagementObjectSearcher(ms,oq);
ManagementObjectCollection queryColl = query.Get(); //Crash
Please tell me what can be wrong.
Thank you
I am trying to list in a web page the processes an the services of a
computer in my workgroup. For my computer I use the windows user and it
works fine. For the remote computer I use admin user and password
entered by text boxes and saved as cookie. The bad part is that I get
"Access denied". The ASPNET user is in Administrators group on my
computer.
ConnectionOptions con = new ConnectionOptions();
if (Request.Cookies["wmiuser"].Value.ToString() != "")
{
con.Username = Request.Cookies["wuser"].Value.ToString();
con.Password = Request.Cookies["wpass"].Value.ToString();
}
ManagementScope ms = new ManagementScope("\\\\" + computer +
"\\root\\cimv2", con);
ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Service");
ManagementObjectSearcher query = new ManagementObjectSearcher(ms,oq);
ManagementObjectCollection queryColl = query.Get(); //Crash
Please tell me what can be wrong.
Thank you