1
votes

My ASP.NET MVC 2 application runs under built-in local NETWORK SERVICE account. I want to set up access permissions for the folder which resides in another computer, but in the same domain. I located that folder right-clicked to open its properties form, clicked to Security tab and pressed Add button which displayed Add user form with correct domain name in the location field. I referred to the account with following syntax:

<domain name>\<server name>$

because I learned that NETWORK SERVICE account uses machine account when connected to other computers in the domain. However, the system couldn't find the account, so refuses to add the account. Without the domain name it adds a user, but that user seems to be local user, not web server's NETWORK SERVICE account. What am I doing wrong?

By the way, the above syntax worked when I created login for the sql server which is different computer from the web server.

2

2 Answers

2
votes

OK, I will answer my own question. The above syntax \$ was correct. Just make sure to select computers checkbox in the object type, when adding user permissions.

0
votes

I have been in this same situation before. I don't think I got it to work with the Server/Network Service but this might be worth a try.

Figure out the account network service is using to access the network resource.

  • Configure windows auditing (on the server the folder is located) to log the failed security events of the folder.
  • or monitor the folder with something like filemon.exe

.. from here you can try and add the account to the security settings of the forlder. (IIRC I did'nt ever get this to work)

Alternatively you can ensure the action is performed under the context of a domain user. Either by:

  • Impersonating the user in code and performing the action (my preference)
  • Setting the impersonation settings in web.config to a named user
  • setting the application pool to run as a domain user.