Double Hop Network Issue

Discussion in 'ASP .Net' started by kellygreer1, Nov 19, 2007.

  1. kellygreer1

    kellygreer1 Guest

    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

    change nospam to yahoo
     
    kellygreer1, Nov 19, 2007
    #1
    1. Advertising

  2. kellygreer1

    LVP Guest

    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.


    "kellygreer1" <> wrote in message
    news:...
    > 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
    >
    > change nospam to yahoo
     
    LVP, Nov 20, 2007
    #2
    1. Advertising

  3. kellygreer1

    kellygreer1 Guest

    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

    change nospam to yahoo




    On Nov 19, 8:55 pm, "LVP" <> wrote:
    > 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.
    >
    > "kellygreer1" <> wrote in message
    >
    > news:...
    >
    > > 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
    > >
    > > change nospam to yahoo
     
    kellygreer1, Nov 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Schaefer

    Re: Windows Auth -- double hop issue??

    Ken Schaefer, Apr 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,070
    Ken Schaefer
    Apr 7, 2004
  2. =?Utf-8?B?Q2h1Y2sgSGFlYmVybGU=?=

    classic IE -> IIS -> SQL Double hop issue - Help needed resolving

    =?Utf-8?B?Q2h1Y2sgSGFlYmVybGU=?=, Oct 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,175
    Bruce Barker
    Oct 15, 2005
  3. double hop issue? Not sure anymore

    , Jan 25, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    166
  4. Christer

    The double hop web service security issue...

    Christer, Oct 10, 2003, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    124
    richlm
    Oct 11, 2003
  5. Anthony
    Replies:
    2
    Views:
    238
Loading...

Share This Page