IIS 10.0 error 500.0 when directory browsing for root drive

azuan 0 Reputation points
2023-05-21T06:06:45.5166667+00:00

hello,

this is my first time in this forum, so apologize if the question is not following the standard format.

here are the scenarios:

i am using IIS 10.0, installing in WS 2022 inside the LAN, while i have another IIS 10.0 running on windows 10 inside the LAN. the website is accessible from the internet via port forwarding from the gateway.

website currently running on windows 10, "directory browsing" enabled. i can browse all directories from the "root drive". for example http://mydomain/D where D is the whole drive D. it will list all the subdirectories including all individual files.

problem is when i enabling "directory browsing" at my WS 2022 IIS, where directory browsing taken from the network share.

for example in the IIS @ WS 2022 what i did:

a. add virtual directory
b. alias = D

c. physical path = \\windows10\D

d. connect as = specific users, where user used were administrator account at the windows 10.
e. test connection = both authentication and authorization were successful

there were 2 errors produced when browsing http://mydomain/D where D is virtual directory pointing to windows 10.

if i just running the virtual directory just like that, it shows asp.net "configuration error", whether i browse the root drive, subdirectories, or files inside the drive. for example http://mydomain/D/ or http://mydomain/D/ABC or http://mydomain/D/thefiles.ext

[No relevant source lines]

but if i convert the virtual directory into application, it shows error 500.0 with error code 0x80070002

but i can browse other subdirectories after D, for example http://mydomain/D/ABC

also i can access files inside D if i type the full url for example http://mydomain/D/thefiles.ext

i don't think it is because authentication, because test connection were successful and i can access files and subdirectories inside it, but not the root drive itself.

is the directory listing module disallow browsing the root drive from network drive, or there is some configuration that i missed out? and why do i need to convert the virtual directory to the application?

regards

azuan

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,129 questions
Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,574 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,286 Reputation points Microsoft Vendor
    2023-05-22T03:02:18.1833333+00:00

    @azuan

    This may be a validation problem, you can try to set the following in the web.config file:

    <configuration>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
      </system.webServer>
    </configuration>
    

    if this doesn't solve the problem, you can use failed request tracking to view detailed error information, this will generate detail log file, which will help you to identify the problem.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. MotoX80 32,726 Reputation points
    2023-05-27T12:52:29.33+00:00

    pass-through authentication is using administrator account.

    Well if you're having a problem accessing a folder, the permissions would be the most obvious problem. Over the years I have found that at times a second set of eyes could see a problem that I missed. If you share the icacls output, it's possible that we will see the problem.

    I haven't tested this theory, but it could be UAC getting in the way. Remember, just because a user is a member of the administrators group doesn't mean that they have access to a folder that grants Administrator full control. The process needs to be elevated to get past UAC if there is no other ACL that grants non admins access.

    RDP to the web server. Open a command prompt and map the drive with the account you are using and see if it works.

    net use x: \\windows10\D /user:administrator thePassword
    dir X:\
    

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. MotoX80 32,726 Reputation points
    2023-06-03T12:20:17.4466667+00:00

    I was able to recreate your error using my laptop to access my test10 VM.

    User's image

    Failed request tracing shows the default document handler not finding "something".

    User's image

    I tried every trick I know of to get this to work and it fails every time. I traced both machines with Process Monitor and nothing shows up as "access denied" or "file not found".

    There is something about referencing the root of a drive that IIS just does not like.

    I did get it working by changing the virtual directory to point to a subdirectory on the share.

    User's image

    Well then I thought that I could fool IIS by creating a symbolic link under the Data folder named Root that pointed back to E:.

    That didn't work either.

    So at this this point it would appear that your best solution is to create a folder named Data (or whatever is meaningful to you) on your D drive, and put all of the files that you want to expose to IIS under that folder.

    Update: I did share out E:\Data and defined a virtual directory to \\test10\data. That worked. So if you have say, 4 folders in your D:\ drive, you could share them all out, and then create the virtual folders under a local "D drive folder" on the web server so that to the end users, it would look like they are browsing the entire D drive.