Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How to change active directory User Account Password using code?

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

I wouldn't do this personally.

But you can as long as you have sufficient permissions something like:

DirectoryEntry myADUser = new
DirectoryEntry("LDAP://CN=User,CN=Users,DC=Domain,DC=com");
myADUser.Invoke("<opass>", "<npass>");
myADUser.CommitChanges();
share|improve this answer
    
where we have to pass username ? –  Rajesh Joshi Nov 2 '12 at 9:14
    
what permission should the loggedin user have to perform this operation? Is it enough to use RWEP to perform this? –  variable Jul 12 at 5:40
add comment

Here's an opensource webpart that enables users to change their password:

ITaCS Change Password web part

I use this webpart myself and am satisfied about it. The source code is available for viewing. It might inspire you for your own programming need.

share|improve this answer
1  
I've been using this in production. It works very well. I recommend it and also recommend reviewing its code. –  BGM Dec 19 '12 at 15:10
add comment

I don't think there's anything wrong with changing active directory password through webpart anyway why reinvent the wheel ? here's link to one already created.

sharepoint-active-directory-change

share|improve this answer
    
how ever de-voted it, provide reason for it ! –  SharePointer Nov 2 '12 at 10:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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