How do I get a directory listing on remote server?

D

Dan King

I have a few ASP pages that run great on a local machine. They read folder
content then display the information in the browser.
I would like to be able to read the same data from several remote servers.
The problem is the remote servers are all in different domains with no
trusts between them, so I cannot run the site as a domain user. I currently
have a login page that gathers user names and passwords. Can I somehow use
those to connect to a remote server? When I look in the Security logs on the
remote server, I can see a login failure from the anonymous IIS user the web
site runs as.

My code currently fails at the third line here:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
response.write strPath 'this is here to verify the PATH is actually correct
Set objFolder = objFSO.GetFolder(strPath)

Is it possible to do something like:
Set objFolder = objFSO.GetFolder(strPath) ,{username},{password}
so I can connect as the user that logs into the site?

BTW, the users already authenticate to their respective domains, and the
users would already have access to the remote shares.
 
J

Jeff Cochran

I have a few ASP pages that run great on a local machine. They read folder
content then display the information in the browser.
I would like to be able to read the same data from several remote servers.
The problem is the remote servers are all in different domains with no
trusts between them, so I cannot run the site as a domain user. I currently
have a login page that gathers user names and passwords. Can I somehow use
those to connect to a remote server? When I look in the Security logs on the
remote server, I can see a login failure from the anonymous IIS user the web
site runs as.

This is all Windows user accounts and permissions. You need to
provide access for the user account that IIS is running as, either
anonymous or the user if you are authenticating.
My code currently fails at the third line here:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
response.write strPath 'this is here to verify the PATH is actually correct
Set objFolder = objFSO.GetFolder(strPath)

Is it possible to do something like:
Set objFolder = objFSO.GetFolder(strPath) ,{username},{password}
so I can connect as the user that logs into the site?

No. But you could use a share that pre-exists.
BTW, the users already authenticate to their respective domains, and the
users would already have access to the remote shares.

If you're using Windows Authentication in IIS then this should allow
access.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top