0

I am having issues trying to access network shares using C# and ASP.NET web based application. I use LDAP Active Directory to perform the login and I have a method that reads files from a specified directory and performs file moves. The directory is shared to specific users and I am unable to access them unless they are shared to the "Everyone" group (which is not how we want to set the security). I would like to access the directories using the username on my AD login somehow. Is this possible? I have been looking into the Directory Security class but no luck so far. Thanks.

2 Answers 2

1

Change the impersonation on your web.config file to a user that have access permission to the share

<identity impersonate="true"
      userName="domain\user" 
      password="password" />
1

There's two ways to solve this grant the User the app pool rums under access to the share or impersonate the AD user when you need to access the share

1
  • I implemented impersonization and that allowed me to use specific share settings instead of "everyone", however, it lead to other issues such as access violations. It would not allow me to access certain directories so I'm looking for another solution.
    – George
    Commented Jul 1, 2011 at 2:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.