Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET & UNC

ASP.NET & UNC

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netsysadminwindows-admin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    izotov
    wrote on last edited by
    #1

    I have an ASP.NET project, which should execute a command (calling Shell() function) on files are shared via UNC. The web server (IIS) and the file server are in the same domain. I have created a domain user, which has rights to read the shared directory on the file server, log on as batch job and log on as service grants on the IIS server and set this user as the anonymus access user under the IIS MMC for the application. And it can not reach the shared files. What is wrong? What is the solution to reach UNC shares from an ASP.NET application? (K)

    C 1 Reply Last reply
    0
    • I izotov

      I have an ASP.NET project, which should execute a command (calling Shell() function) on files are shared via UNC. The web server (IIS) and the file server are in the same domain. I have created a domain user, which has rights to read the shared directory on the file server, log on as batch job and log on as service grants on the IIS server and set this user as the anonymus access user under the IIS MMC for the application. And it can not reach the shared files. What is wrong? What is the solution to reach UNC shares from an ASP.NET application? (K)

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Anonymous Access means that IIS will use a special account to access the files. You must grant this account rights to the directory in order to read/write to the directory. The exact account name depends on the way your system is set up. To find the name of the account go to Administative Tools-->Internet Information Service Open the tree and select the appropriate virtual directory. Right-Click-->Properties Select the Directory Security Tab Click "Edit" in the Anonymous access group. You'll see the account that ASP.NET uses to access resources as an anonymous user. --Colin Mackay--

      EuroCPian Spring 2004 Get Together[^]

      I 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Anonymous Access means that IIS will use a special account to access the files. You must grant this account rights to the directory in order to read/write to the directory. The exact account name depends on the way your system is set up. To find the name of the account go to Administative Tools-->Internet Information Service Open the tree and select the appropriate virtual directory. Right-Click-->Properties Select the Directory Security Tab Click "Edit" in the Anonymous access group. You'll see the account that ASP.NET uses to access resources as an anonymous user. --Colin Mackay--

        EuroCPian Spring 2004 Get Together[^]

        I Offline
        I Offline
        izotov
        wrote on last edited by
        #3

        The problem is that when you want to reach a remote resource from ASP.NET the ASPNET account should have extra permissions. (The account under Administative Tools --> Internet Information Services --> Properties --> Directory Security Tab is responsible for IIS and not for aspnet_wp.exe which will execute our function.) That is why I had to replace ASPNET account for aspnet_wp to a domain wide one, give her the sufficient privileges and rights to the local and remote resources. Now the domain account has rights to see anything allowed in the domain, and the function call can be performed on the UNC shared file. Scenario: 1. create a new domain account 2. on the IIS machine assign to it logon as batch job logon as service privileges 3. assign to it NTFS permissions on the IIS and on the UNC sharing machine 4. in machine.config's ser userName and password according to your new domain account Detailed information on replacing aspnet_wp's account: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT01.asp (K)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups