I am using the below code to change the password. It gives me an error
Exception has been thrown by the target of an invocation. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I Checked the active directory server and everything looks fine(all permissions to change the password is set ) . I am able to login to the server but I am not able to do any other operations ..
Any ideas would be appreciated.
DirectoryEntry de = new DirectoryEntry("LDAP://abc.xyz.net", txtUserName.Text, txtPassword.Text);
DirectorySearcher deSearch = new DirectorySearcher();
You need to run the site in an application pool with appropriate AD permissions to change stuff in AD. Of course, you should be certain that unauthorized users cannot access the app as they can then change stuff in active directory.
Bookmarks