Double Hop Network Issue

K

kellygreer1

Still working on trying to solve this issue. I have an ASP.NET aspx
page that needs to copy a file to a fileshare on another server.

As a simple test I have been trying to do the following:
string fullPath = @"\\someserver\someshare\log.txt";
File.WriteAllText(fullPath,"test");

I get an error.
I even get an error if I try to use the code from:
http://www.codeproject.com/useritems/User_Impersonation_in_Ne.asp
I call the impersonate() method right before my WriteAllText call.
Is there something wrong with the codeproject code?

I have also tried using the impersonate stuff in the web.config with
no luck.

I am using IIS 5 on Windows 2000 as the ASP.NET server.

Thanks,
Kelly Greer
(e-mail address removed)
change nospam to yahoo
 
L

LVP

This will not help but read it.

what happens if you open the share folder on someserver\someshare from your
executing code-server, then see what happens.
( yes Start-Run- type \\someserver\someshare\ then authenticate
manually ) this is just a test
after you manually logon on the share folder then run your code and if it
works then you know is is authentication problem still.
some impersonation code worked for me and it did not work for me for some
servers.
I don't know why either. you might have to be on the same domain or
something... I am still trying to figure it out.
 
K

kellygreer1

Thanks I'll try that.

I guess I'll also try the LogonUser API from a "Thick Client" on my
local machine and see what happens. The LogonUser calls returns
0 ...meaning the logon itself is failing... don't know why. Does an
ASPX page need to being running with some certain set of permissions
to be able to use the LogonUser API?

I will probably move over to Windows 2003 and IIS 6 if I keep having
issues. I'll try changing the security context of the application
pool.
It's a shame this isn't easier to solve. I wasted at least 4 hours on
this today.

Kelly Greer
(e-mail address removed)
change nospam to yahoo
 

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,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top