Can't get ASP.Net to access remote folder share

Discussion in 'ASP .Net Security' started by Garrek, May 16, 2004.

  1. Garrek

    Garrek Guest

    I have a WebService executing on one server in a workgroup which needs
    to reach out to a folder share on another server for read/write access.

    I've created an identical user account on both systems (matching in
    username and password). I've approached the problem by writing a
    utility class that calls the Win32 API LogonUser method. The idea was
    to have the code temporary impersonate the user account, access the
    remote UNC folder share, and then return the context back to normal.

    The problem is that well... it's just not working =) As soon as I
    call File.Exists(filePath) I always get a false return signifying the
    file doesn't exist or I don't have access. Now I've confirmed the user
    account on the remote system has read/write permission on the share.

    Any ideas?
     
    Garrek, May 16, 2004
    #1
    1. Advertising

  2. It sounds like one of two things is happening. Either the account that is running ASPNET is not functioning correctly (if it is running as another user aside from ASPNET), or the Win32 LogonUser method is not impersonating the user correctly. Just before you make the call to the LogonUser method, check the Context.User.Identity property to see what ASPNET is running as. If that is functioning correctly, I would focus on the impersonation in the Win32 call.
     
    David Coe, MCP, May 18, 2004
    #2
    1. Advertising

  3. Garrek

    Garrek Guest

    Thanks David, I'll take a look at the Context.User.Identity and see
    what's going on.


    On 2004-05-17 19:16:05 -0500, "David Coe, MCP"
    <> said:

    > It sounds like one of two things is happening. Either the account that
    > is running ASPNET is not functioning correctly (if it is running as
    > another user aside from ASPNET), or the Win32 LogonUser method is not
    > impersonating the user correctly. Just before you make the call to the
    > LogonUser method, check the Context.User.Identity property to see what
    > ASPNET is running as. If that is functioning correctly, I would focus
    > on the impersonation in the Win32 call.
     
    Garrek, May 18, 2004
    #3
  4. Garrek

    Prodip Saha Guest

    Garrek,
    I experienced the similar problem but got it resolved using a technique
    called Mirrored Account. I found this the simpliest possible solution.
    Search microsoft site for 'Mirrored Account' for additional help.

    Prodip

    "Garrek" <> wrote in message
    news:2004051602255416807%garreknospam2001@hotmailcom...
    > I have a WebService executing on one server in a workgroup which needs
    > to reach out to a folder share on another server for read/write access.
    >
    > I've created an identical user account on both systems (matching in
    > username and password). I've approached the problem by writing a
    > utility class that calls the Win32 API LogonUser method. The idea was
    > to have the code temporary impersonate the user account, access the
    > remote UNC folder share, and then return the context back to normal.
    >
    > The problem is that well... it's just not working =) As soon as I
    > call File.Exists(filePath) I always get a false return signifying the
    > file doesn't exist or I don't have access. Now I've confirmed the user
    > account on the remote system has read/write permission on the share.
    >
    > Any ideas?
    >
     
    Prodip Saha, May 21, 2004
    #4
    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. Andrew Shitov

    How to access a network share folder?

    Andrew Shitov, Sep 13, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    23,070
    GrantMagic
    Sep 13, 2004
  2. =?Utf-8?B?cGpfc2VydmFkbWlu?=

    Running an asp.net application on a remote share (UNC) - parser er

    =?Utf-8?B?cGpfc2VydmFkbWlu?=, Jun 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,603
    =?Utf-8?B?cGpfc2VydmFkbWlu?=
    Jul 1, 2005
  3. Guest

    run ASP.NET from a remote share

    Guest, Nov 11, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    567
    Juan T. Llibre
    Nov 14, 2005
  4. Tim Chandler
    Replies:
    0
    Views:
    228
    Tim Chandler
    Oct 7, 2003
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,374
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page