Getting access denied when trying to extract system information using a asp.net web application

374 views Asked by At

I have created a asp.net web application using C# that extracts system information remotely using WMI. I am able to extract the data when i run it in my visual studio dev enviroment and am able to get data from machines in the same domain, but when I hosted my application through the windows server 2008 R2, I am getting access denied when i try to extract the remote computer which is in a different domain. I also tried to extract the data by running it in the server itself but still access denied. Please advice.

Error shown below

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

2

There are 2 answers

0
hugry clide On BEST ANSWER

The solution was just to utilize connectionOptions and input the username and password which has access to the domain to remove the Access Denied.

2
SteveFerg On

There seems to be a permissions issue with the remote computer. It could the IUSR and/or IIS_IUSRS group. Some services also use NETWORKSERVICE user account. Normally you wouldn't want to mess with those permissions.

One thing you might try is adding privileges to IIS AppPool\MyApplicationPoolName (IIS AppPool\YourDomainHere.com)

see also: IIS_IUSRS and IUSR permissions in IIS8