Author: JRing | Posted on: 12/19/2002 12:36:50 PM | Views : 469

Okay,

I have been trying for months to find the correct code to reset a user's password in Active Directory. We're trying to do this using ASP.net and C#. Here is what I have so far:

ActiveDs.IADsUser User = (ActiveDs.IADsUser)myEntry.NativeObject;
User.SetPassword(newPassword);
User.SetInfo();
user.CommitChanges();

We've also tried this:

user.Invoke("SetPassword", new object[] {newPassword});
user.CommitChanges();

Both work (sometimes) from my machine (inside our firewall), but once we get outside, this stuff doesn't work. I am passing userID and password to the DirectoryEntry call and setting the AuthenticationType to Secure.

We can get the 2nd code piece to work fine if using "ChangePassword", but we need this to work if we don't have the user's old password.

Any help will be much, much appreciated.
Go to the complete details ...