Accessing remote network resources from ASP.NET applications

D

Dilip

Hi All

Sorry to bring up a beaten-down-to-death topic. But I seem to be
running into a wall whatever I try here. To cut a long story short, I
have an ASP.NET application that tries to move a file from box A to
box B. Box A and B are in the same domain. My security settings are
like this:

* The site's virt directory is configured for anonymous access with a
specified domain user and password (not IUSR_machinename) -- IOW, IIS
does not control the password.
* My web.config has authentication mode as "none" and impersonate as
"true" (non-user-specific).
<authentication mode="None" />
<identity impersonate="true" />

The domain\user specified in the anonymous access settings in IIS has
the rights to access the remote machine's folder location (full
access). FWIW, This particular folder on Box B is mapped as a shared
drive in Box A.

My call to FileInfo.MoveTo(destination_in_box_b) repeatedly fails with
DirectoryNotFoundException.

Can someone _please_ help me out here?

thanks
--Dilip
 
K

Ken Schaefer

Hi,

I don't think this is an impersonation or authentication problem. I think
the problem is your use of mapped drive letters. A drive letter is mapped
for the logged on user only. So whatever user account you used to map the
drive letter to a share on ServerA is the only account that can see that
mapping. Any other user does not see it.

Instead of using mapped drive letters, use UNC paths (\\server\share)
instead, since all users can see that. If you are correct about how you've
setup your Domain account, and the permissions, everything should work then.

Cheers
Ken

: Hi All
:
: Sorry to bring up a beaten-down-to-death topic. But I seem to be
: running into a wall whatever I try here. To cut a long story short, I
: have an ASP.NET application that tries to move a file from box A to
: box B. Box A and B are in the same domain. My security settings are
: like this:
:
: * The site's virt directory is configured for anonymous access with a
: specified domain user and password (not IUSR_machinename) -- IOW, IIS
: does not control the password.
: * My web.config has authentication mode as "none" and impersonate as
: "true" (non-user-specific).
: <authentication mode="None" />
: <identity impersonate="true" />
:
: The domain\user specified in the anonymous access settings in IIS has
: the rights to access the remote machine's folder location (full
: access). FWIW, This particular folder on Box B is mapped as a shared
: drive in Box A.
:
: My call to FileInfo.MoveTo(destination_in_box_b) repeatedly fails with
: DirectoryNotFoundException.
:
: Can someone _please_ help me out here?
:
: thanks
: --Dilip
 
D

Dilip

Hi Ken

Ken Schaefer said:
I don't think this is an impersonation or authentication problem. I think
the problem is your use of mapped drive letters. A drive letter is mapped
for the logged on user only. So whatever user account you used to map the
drive letter to a share on ServerA is the only account that can see that
mapping. Any other user does not see it.

I knew this -- now my question is does this hold true even if I
impersonate the same user using which I created my drive mappings?
Thats what is happening in my case. I created the drive mappings
using "domain\user1" and that is the same user I am asking IIS to
authenticate in the anonymous user settings.

Or maybe I should implement LogonUser and start a new login session
with a interactive logon type and *then* execute the file move?

Its pretty easy to switch to UNC names but the thing is this code used
to work just 2 days ago and all of a sudden stopped working (don't ask
me why.. I have no idea!)

thanks
--Dilip
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top