1

I have built an asp.net website using visual studio 2012. My website contains various webforms(aspx). The purpose of my website is to monitor few processes on different machines on my network, i am gathering all the required information in code behind files (aspx.cs) using System.Management Class.

The website is working fine on visual studio development server, but when create a virtual directory on my IIS, I didn't get any errors but i am unable to fetch the information of the machines on my network. The information i am fetching include the couple of processes and their start time, The machine name, machine uptime.

Khurram
  • 31
  • 1
  • 5
  • Not a lot to go on here. Usually these things are credential related. Got any code? – Crowcoder Sep 28 '17 at 00:35
  • What is the error? Do you mean it works on IIS Express only when local? Try setting the App Pool to "NETWORK SERVICE"? – IrishChieftain Sep 28 '17 at 00:47
  • I have tried changing to "NETWORK SERVICE" but it didn't work – Khurram Sep 28 '17 at 01:37
  • What you want to look into is Windows authentication and/or impersonation depending on if you want to use the credentials of the user of the site or any user of the site. – Crowcoder Sep 28 '17 at 10:57

3 Answers3

0

When you are running the process in visual studio in debug, it's running under your username. Whereas when running on IIS, it's running as AppPoolIdentity. Check to see if the user that app pool is using has proper permissions to query processes on those machines.

farzaaaan
  • 410
  • 3
  • 9
0

go to application pool, and set your application pool to use local system account

Ray H
  • 491
  • 3
  • 7
  • It is bad advice to give the process all those rights just to get the few you need. And it's not guaranteed to work, we have not been told anything about the network/domain. Imagine if you could just do that and get access to any server from any pc .... – Crowcoder Sep 28 '17 at 00:48
  • well my machine on which i am developing and the machines i am accessing are not on any domain. I have save the credentials and IP addresses of the machines in a sql server database. – Khurram Sep 28 '17 at 01:39
0

You need to verify IIS_IUSRS & IUSR permissions for your site & other resources.

read more

enter image description here