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

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

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

    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 Guest

  2. Similar Questions and Discussions

    1. Access remote folder files in the network
      In my ASP.NET application, all the images files are stored on a machine other than my web-server. In a webform i am accessing the image files stored...
    2. Win 98 connect win 2003 share folder
      Can a win 98 connects win 2003 share folders? I got a message ask for password with resource \\computername\IPC$ Both win 98 and win 2003 have...
    3. Setting folder permissions on remote machine / remote domain
      Hello there, I have the following problem: I have Machine A which runs my website. I have Machine B which holds folders for users. Machine A...
    4. folder access in share
      In article <un6Zq$9RDHA.3768@tk2msftngp13.phx.gbl>, "WILLIAM WELBORN" <bwelborn707@email.uophx.edu> wrote: That message is very misleading. The...
    5. Share Program File Folder
      I would like to share the Program File folder on my home network. When I right click on the folder and go to properties and click on the share tab...
  3. #2

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

    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 Guest

  4. #3

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

    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"
    <anonymous@discussions.microsoft.com> 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 Guest

  5. #4

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

    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" <garrek_no_spam_2001@hotmail.com> wrote in message
    news:2004051602255416807%garreknospam2001@hotmailc om...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139