Impersonate active directory user in vb.net

I've never programmed an active directory, but would like to do the following:

  • On the asp.net site, log in with a valid active username and password. If the login is valid, please redirect to the page to perform some actions.

  • In a related task, but not in part 1, open an account or change the password for an active directory account.

Thanks!

+1


a source to share


2 answers


1.) You must configure your web.config to use forms authentication. The membership provider must be set to ActiveDirectoryMembershipProvider. You can use the built-in inputs control.



2.) You need an Active Directory user who has certain rights that you are asking for: unlock accounts, change passwords. When you perform one of these functions for an AD user, you need to impersonate the account that ASP is running against the Active Directory user that has privileges (to change passwords or unlock accounts).

0


a source


You may be able to use "advapi32.dll" to impersonate another user on the server side.

Take the example code at the bottom of the page.

I didn't want to just copy his code here.



http://csharptuning.blogspot.com/2007/06/impersonation-in-c.html

One lane with impersonation, however, is that the computer doing the impersonation must be in the same domain as the user who is impersonating

0


a source







All Articles