Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading folder contents of remote server with asp! 2

Status
Not open for further replies.

WebChick71

Programmer
Jul 20, 2007
4
US
Hello everyone, I have a project that I need to be able to read the contents of remote folders on other servers on our network all from one page. Is this possible. Here is scenario.

Server A is an IIS Web server

Server B and C are just documentation servers.

I need to be able to use Server A to read the folder contents of Server B and C. I have a script that reads folder contents, but only for folders/drives on that box.

Is this possible? I have tried a few different approaches and never get anywhere. Any help anyone has would be so much appreciated

 
Security is the first issue you'll need to resolve.

By default, your ASP is executed in the security context of a local account... I mean an account that only exists on your web server. This account has no network credentials.

So the first thing you'll need to do is change the way that ASP is executed. You can do this for your entire ASP application or just for the particular ASP that needs to access network resources. You have two choices:
1) Anonymous - The same network-enabled account is used for everyone
2) Authenticated - Each user must provide their own credentials so those without sufficient permissions will not be able to run the script.
 
Oh and IUSR_TheNameOfTheServer is the name of the default local account.
 
Thank you, I have tried setting up permissions etc.. it does not seem to work. have you done this before? I have been trying to find code somewhere to help me out.

Suzanne :)
 
I haven't done this in quite a while, so I may be misremembering. The easiest option I recall was to change the default user for the area that needs access to a domain user. Give that domain user access to the folders on the remote systems that it needs access to (with inherited permissions set for subfolders). Then use a UNC path (\\machinename\share\etc\) to access the folder from your FSO script.

-T

Best MS KB Ever:
 
That sounds like a plan, howe do you give one domain user access to those folder on the other server? In active directory?

Suzanne :)
 
Provided they are both part of the domain, you should be able to go straight to the folder permissions and give them access there. You will also need to create a share that the user has access to that will be the folder in \\machine\folder\.

-T

Best MS KB Ever:
 
Here is my main question, how on the asp page do you specify the username and password for the account that will have access to that shared folder, this is something that I have not had to do before. Thanks

Suzanne :)
 
If you use the "Authenticated" method then the credentials of the current user will be in effect.

If you want to use the same account for everyone then enable "Anonymous" for the page but then change the account from the default IUSR_Xxxxx to a domain account in your AD.

You can use the IIS Administration tool to choose the access method:
Control Panel -> Administrative Tools -> Internet Information Services

Just right-click the page and choose Properties from the popup context-menu and then choose the Security tab and then click the Edit button in the Authentication control frame.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top