Reset Password.....

B

Balaji

Hi All,

I am trying to change the password of a user in Active
Directory. I tried using

object[] oPassword = new object[] {"<oldPassword>","<newPassword>"};
userEntry.Invoke("ChangePassword",oPassword);

when i tried this i am getting error "InteropServices.COMException'.
Hence i tried using

object[] oPassword = new object[] {"<newPassword>"};
userEntry.Invoke("ChangePassword",oPassword);

This works fine and the password gets changed.Then i tried login with
the old password and new password both passwords works. I need the user
should use the new password to login can any pz help me to solve this
problem.

Thanks
Balaji Krishnamoorthy
 
W

Willy Denoyette [MVP]

Balaji said:
Hi All,

I am trying to change the password of a user in Active
Directory. I tried using

object[] oPassword = new object[] {"<oldPassword>","<newPassword>"};
userEntry.Invoke("ChangePassword",oPassword);

when i tried this i am getting error "InteropServices.COMException'.
Hence i tried using

object[] oPassword = new object[] {"<newPassword>"};
userEntry.Invoke("ChangePassword",oPassword);

This works fine and the password gets changed.Then i tried login with
the old password and new password both passwords works. I need the user
should use the new password to login can any pz help me to solve this
problem.
If this is true, Microsoft is in big trouble :)

The second code snip can't run, it should throw an TargetInvocationException
with an "invalid number of arguments" inner exception.

The first code snip is correct, what is the complete exception message!

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top