Link to home
Start Free TrialLog in
Avatar of DTRON04
DTRON04

asked on

Access to Shared/Mapped Folder with FSO in ASP.net

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 ASP.net 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
http://www.dotnet247.com/247reference/msgs/2/10167.aspx












 
SOLUTION
Avatar of AerosSaga
AerosSaga

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
Avatar of DTRON04
DTRON04

ASKER

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.
Thanks


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
DTR:

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.

John
Avatar of DTRON04

ASKER

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.
http://www.15seconds.com/issue/030926.htm

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







ASKER CERTIFIED SOLUTION
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
Avatar of DTRON04

ASKER

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.

Thanks!!


Your very welcome, glad I could be of some assistance.