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
cimscimsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Does the IUSR account have permission on/to access the folder?
Certainly would be a default permission
0
Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
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
0
cimscimsAuthor Commented:
I'm using the Windows Authentication and Impersonation is True.
Would you guide me sttting up the user that runs the application pool identity.
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
0
cimscimsAuthor Commented:
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
******************************************************
0
Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
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
0
cimscimsAuthor Commented:
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?
0
Emmanuel AdebayoGlobal Windows Infrastructure Engineer - ConsultantCommented:
Is PRODSERV1 in your domain or a workgroup server?
0
cimscimsAuthor Commented:
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.
0
cimscimsAuthor Commented:
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.
0
cimscimsAuthor Commented:
Here is what i'm trying to do.

-- Create a service account in the domain

In PRODSERV1:
1) Add the user account part of the IIS_WPG group
2) Allow the service account to 'Run as a service'
3) In the Local Security Policy editor, select 'User Rights Assignment' from the hierarchy in the left pane, and the select the 'Log On as a Service' from the right pane
4) Add the service account as an application pool identity that runs the application pool

In SERVER1:
1) Give Read/Write access to the same service account that was created in the Domain

Hope this solves the issue. I have requested server guys for creating the service account. Shall post as soon i finish the process
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cimscimsAuthor Commented:
Close the request
0
cimscimsAuthor Commented:
It worked with my solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.