Link to home
Start Free TrialLog in
Avatar of cimscims
cimscims

asked on

401 - Unauthorized: Access is denied due to invalid credentials

I have a web page and i trying to generate an XML file and store in network drive(\\SERVER1\TEST FOLDER1\). I have problem while storing the file. When i change the path to "D:\TEST FOLDER2\" it works fine. But if give the network folder it fails..it gives me the attached error. Find the event log info. I think i'm missing some permissions here..please shed a light on this.. Thanks in advance

******************************************************
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 10/7/2013 12:50:25 PM
Event time (UTC): 10/7/2013 4:50:25 PM
Event ID: 9b294618926d4ccb90f591cc9d414e6a
Event sequence: 14
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT/LibRequest-5-130256382176985345
    Trust level: Full
    Application Virtual Path: /BookRequest
    Application Path: D:\Test\Request\
    Machine name: PRODSERV1
 
Process information:
    Process ID: 6500
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Request information:
    Request URL: http://PRODSERV1/BookRequest/BookRequest.aspx 
    Request path: /BookRequest/BookRequest.aspx
    User host address: 199.167.135.102
    User: TDOM\YZ8765
    Is authenticated: True
    Authentication Type: NTLM
    Thread account name: NT AUTHORITY\NETWORK SERVICE
******************************************************
Error.JPG
Avatar of Gary
Gary
Flag of Ireland image

Does the IUSR account have permission on/to access the folder?
Certainly would be a default permission
The identity running your application pool does not have access to the location you are writing to

You will need to set up a user that will run your application pool identity and grant that use the Read/Write to that folder you are writing to.

See the link below for more info

http://www.iis.net/learn/manage/configuring-security/application-pool-identities
Avatar of cimscims
cimscims

ASKER

I'm using the Windows Authentication and Impersonation is True.
Would you guide me sttting up the user that runs the application pool identity.
I have created a user "IUSR_BookRequest" and assigned the user to run the application pool. But how should i grant access the new user to the network drive(\\SERVER1\TEST FOLDER1\)?

When i run the application, i got the below error.

******************************************************
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 10/7/2013 02:16:25 PM
Event time (UTC): 10/7/2013 6:16:25 PM
Event ID: 9b294618926d4ccb90f591cc9d414e6a
Event sequence: 14
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT/BookRequest-5-130256382176985345
    Trust level: Full
    Application Virtual Path: /BookRequest
    Application Path: D:\Test\Request\
    Machine name: PRODSERV1
 
Process information:
    Process ID: 6500
    Process name: w3wp.exe
    Account name: PRODSERV1\IUSR_BookRequest
 
Request information:
    Request URL: http://PRODSERV1/BookRequest/BookRequest.aspx 
    Request path: /BookRequest/BookRequest.aspx
    User host address: 199.167.135.102
    User: TDOM\YZ8765
    Is authenticated: True
    Authentication Type: NTLM
    Thread account name: PRODSERV1\IUSR_BookRequest
******************************************************
Is this user running your application pool?

Have you granted the required permission for the user for \\SERVER1\TEST FOLDER1\?

You grant access to the folder by

Right click \\SERVER1\TEST FOLDER1\ and select Properties
Select the Security Tab
Click on Add to add the user that you created  - PRODSERV1\IUSR_BookRequest
Select the appropriate permission
Click ok
I couldn't see the PRODSERV1\IUSR_BookRequest user in the security tab as it is saying the user is not available as it searches in another server not the PRODSERV1. Any idea?
Is PRODSERV1 in your domain or a workgroup server?
I think it is a workgroup server. We have two networks one for internal and another for external i.e internet. Usually we develop intranet apps. This time we have a requirement for external app. PRODSERV1 is on the external network and i'm using my Active Directory details to login to that server. I will be at office in another 1 and half hour and can give you more details. Please let me know if you want more info.
PRODSERV1 and the server SERVER1 on which the TEST FOLDER1("\\SERVER1\TEST FOLDER1\") are on the same domain. So, how to give access to PRODSERV1's ISUR_BookRequest read/write access to SERVER1?

Hope i'm clear in asking the question. Otherwise let me know.
ASKER CERTIFIED SOLUTION
Avatar of cimscims
cimscims

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Close the request
It worked with my solution.