Monday, September 5, 2011

Access to path \\remotewinXP\folder\ is denied

Based on my test, you could choose either of these two ways. The recommended one is to use a domain user. As mentioned above, you could use impersonation programmatically. The second one is also suitable if you're not familiar with impersonation. I tested it and everything works well. Here're the steps:

  • Step 1. Create a system user e.g. ForASPNET on the machine which hosts the ASP.NET application.
  • Step 2. Grant the same permissions like ASP.NET built-in account Network Service. You could start the Visual Studio Command Prompt and run this command "aspnet_regiis -ga ForASPNET".
  • Step 3. Create a system user in the shared server with the SAME name and password.
  • Step 4. Grant the permissions to the shared file to the user ForASPNET.
  • Step 5. Set the Identity as ForASPNET in the ApplicationPool which the ASP.NET application is running under.

After these steps, you could resolve the problem.

Thanks.

No comments:

Post a Comment

Earn Money ! Affiliate Program
Open Directory Project at dmoz.org