"The provided folder does not exist or is unaccessible!" error when trying to access files on network shared drive from IIS10 server

Shastri, Shrinivas 5 Reputation points
2025-06-05T19:28:53.3+00:00

Hi,

I am facing "The provided folder does not exist or is unaccessible!" error for files on shared network drive.

Client Environment:

-Windows 2022 Server that hosts web site/web api in IIS10. Web Site is developed in Angular and Web Api in .Net4.8

-IIS is configured to use Windows Authentication. IIS is running under dedicated domain account.

-MS SQL database hosted in another Windows 2022 server

-There is shared network drive that has files in different directories

-All servers are in same domain

When web site is opened on IIS Server itself, everything works fine. Web site gets all data from database and can access shared drive files. All data and files access is done via Web Apis.

.Net Code in Web Api file access:

status = System.IO.File.Exists(documentFullPath);

if(status)

{

Byte[] bytes = System.IO.File.ReadAllBytes(documentFullPath);

}

Issue: But when web site is opened from another workstation (Windows 11) in same domain, it gets all data from database but can't access shared drive files. The HTTP call shows error "The provided folder does not exist or is unaccessible!". When I type the file network path in File Exploreron workstation, I can see files. Proper delegations have been created for IIS domain account, IIS Server and Shared File Server in AD for CFS. Is it related to Windows Authentication not propagating correctly? What other configuration/setting is needed here?

Please help.

Sri

Windows development | Internet Information Services
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tom Tran (WICLOUD CORPORATION) 10 Reputation points Microsoft External Staff
    2025-06-13T04:32:06.16+00:00

    Hi Shastri, Shrinivas,

    From what you described, it sounds like the issue is related to how Windows Authentication handles access to network resources when the site is accessed remotely. This is a common problem called “double-hop”, where credentials aren’t passed from the client to the file server.

    Here are a few things you should check to make sure it is working properly:

    1. Make sure your IIS Application Pool is running under a domain account (not the default identity).
    2. Confirm that Kerberos is being used for Windows Authentication by enabling IIS logs, as it supports delegation and NTLM doesn’t.
    3. In Active Directory, set up constrained delegation for the domain account so it can access the file server (CIFS service).
    4. Double-check that the domain account has read access to the shared folder — both share and NTFS permissions.

    Link: https://learn.microsoft.com/en-us/iis/web-hosting/configuring-servers-in-the-windows-web-platform/configuring-share-and-ntfs-permissions

    If you have the time, you can take a quick look at these documents:

    Best regards,

    Tom Tran

    2 people found this answer helpful.

  2. Bruce (SqlWork.com) 78,161 Reputation points Volunteer Moderator
    2025-06-05T22:16:45.8533333+00:00

    you are correct. you are hitting the one hop rule. by default, for file access IIS uses the windows identity, not the pool account to access files. you have 2 options:

    1. file access uses the thread's windows identity. you probably have impersonation enabled. if so, impersonate a domain account to access the share. if not needed, disable impersonation. be sure the anonymous account also uses the pool account.
    2. switch to kerberos, and enable delegation.
      https://techcommunity.microsoft.com/blog/iis-support-blog/setting-up-kerberos-authentication-for-a-website-in-iis/347882

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.