Access to Shared/Mapped Folder with FSO in

This issue is starting p*ss me off a bit.

I created a page in regular ASP/IIS 5.0 on my PDC to go find files on my file server and write the links back to the page as HTTP links using a Virtual Directory Path.
So users can click and download the files.

All works fine. I do remember adding a IUSR_IISSERVERNAME account to the File Server to allow me access to the shared files.
Or atleast thats what i thought it was for.

Now I am in the process of doing the exact same thing on a Different IIS server in to speed up performance.

I get the error: Logon failure: unknown user name or bad password.
Regardless of how i reference the path. \\Server\Share or H:\Share (Mapped Drive) i get this error. I even tried \\server\H$\Share
I tried adding the new IUSR_IISSERVERNAME to the File Server and gave the account read permissions but with no success.

i call the file lookup with the System.IO.Directory.GetFiles(path,name) command
I am sure this a permissions issue relating to the IUSR_SERVERNAME account not having the rights to access the network share.

Any help would be greatly appreciated with this.

To make things more clear here is a link with basically my exact same problem

Who is Participating?
jnhorstConnect With a Mentor Commented:
OK, I think I see.  I originally thought you were trying to get to files on your PDC box (the one with IIS, right?).  Since you are trying to navigate to another server by way of a UNC path (I assume), what you want to do is create a *domain* account (not a local account on the file server) and give that domain account the necessary privileges for the file share.  Then change the IIS setting to use that domain account to authenticate anonymous requests.  Leave the <identity /> tag in web.config.

I did something like this before where I built a menu system based on the folder tree of a share on the file server and then had links to the files that were in the folders.  I had to have a domain account for anonymous access so I could grant persmission to the file server share.


AerosSagaConnect With a Mentor Commented:
did you try both of these workarounds?

This was well documented for ASP,
and should behave the same way for ASP.NET,
since it's a permissions problem.

Basically, when you access a dir/file on a network share,
it's your MACHINE which is accessing and the user
account doing the accessing is IUSR_computername.

Resolution is creating a user account on the computer on which
the network share resides and assigning the proper access
permissions to that account. This account MUST be named
with the EXACT name AND password which the anonymous
account has in the box hosting the web server ( and ASP.NET ).

Some database operations run under the SYSTEM account.
Those operations will fail with database files on the network share.

But directory listings and other operations on text/xml/html files,
like parse/copy/modify/delete, will work.


Juan T. Llibre
Microsoft MVP [IIS/ASP]
ASP.Net En Español :


If you are usoing winNT you will notice the difference when you assign a directory tu a website in IIS

Local drives are assigned differently than the network drive (2 different choices) That means the IIS treat them differently. Can you get a clue from this.

I think if the directory is a sub directory of the web dir assigned in IIS it will work. Others have to be accessed via a virtual dir.

Create a virtual dir in IIS for the net work drive you want to acces and then access the virtual dir from

This should work.

I am sure there is a similar procedure in Appache also!
DTRON04Author Commented:
hey aero

well i tried the IUSR_IISSERVER2 added to the local Filer Server account but it does not treat it the same way it treats my PDC IUSR_ACCOUNT.
Basically active directory does not list the IUSR account for the second web server. So i think that is why it is not working.

With the virtual directory solution what would be the specific path i should use?
That is what is confusing me.

I know how to buld the http link to use the virtual directory but is this how i should reference when doing the FSO lookup.

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I think what its saying is that once you tell create a virtual directory in IIS you can reference it from the virtual root of the IIS dir like /MyMapedServerVirtualDirectory/files.aspx

You probably need to add the following to your web.config:

<identity impersonate="true" />

This is not in web.config by default, and this causes ASP.NET to attempt to access server resources under the local ASPNET account.  With allow anonymous enabled, when you add the identity tag above, it will tell ASP.NET to use the IUSR_<machine> account instead.  This should solve the problem.

DTRON04Author Commented:
Okay i added that line to web.config
Now instead of the error it prompts me for user name and pass when it tries to access the share.
or when typing in the exact path to a file in the virtual directory as the address.

Here is what i have done so far.

Setup Virtual Directory with anymouse access and connected with the administrators account
Added the IUSR_IISSERVER user to the FS01 to match what the actual IIS default account.
Added the <identity impersonate="true" /> to the web.config

Now i did find this article that addresses my issue with a COM+ solution.

Have either of you guys done what i am trying to do?
If so did it work for you?

DTRON04Author Commented:
Well i am fresh this morning
Thanks jnhorst your explanation worked perfectly.
im not sure why i couldn't contemplate that yesterday but all looks perfect now.
I appreciate both your answers as they were correct.
Aeros you will be getting the full 500 from the other question you helped me with yesterday.


Your very welcome, glad I could be of some assistance.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.