Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what are all the Permissions need for ASP.NET application on web server to access shared folder on another server
Posted

By default, the Asp.net worker process runs under the built in "ASPNET" or "Network Service" user account which does not have enough permission to access shared folder on another server.

So, you need to override your application setting so that, your application runs under a different user account. That is called Impersonation.

All you have to do is the followings:

1. Create a user account on your server and make sure that user account has sufficient permission to access the shared folder from within the web server.

2. Impersonate your application by adding the following configuration element in the web.config of your application:

<identity impersonate="true" username="theNewlyCreatedUserAccount" password="Password of the user account" />
 
Share this answer
 
v2
1- Provide the read permission on the shared folder to "Everyone" [NOT RECOMMENDED]


2- Run the application by setting the impersonation of an account having read access to the shared location as following in the web.config file [NOT RECOMMENDED]

<identity impersonate="true" userName="UserName" password="MyPassword"/>



3- Impersonate only the portion of code which is accessing the shared folder and undo the impersonation once you are done. For this you can check MSDN [RECOMMENDED SOLUTION] http://msdn.microsoft.com/en-us/library/chf6fbt4.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900