Sign up ×
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

4 Answers 4

up vote 3 down vote accepted

I wouldn't do this personally.

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

DirectoryEntry myADUser = new
myADUser.Invoke("<opass>", "<npass>");
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 '14 at 5:40
Please can you answer my question above . Thanks. – variable Aug 5 '14 at 3:44
The Change Password permission in AD, on system and elevate the task, or not at all if its their own password by default I believe. You are best to go check with the Active Directory team what you are allowed to do. – Hugh Wood Aug 6 '14 at 10:59

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
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

I would also add to the list of the web parts that you can use to change your AD password within SharePoint environment is Virto SharePoint Change Password Web Part. It supports both AUTH methods - AD and Form-based. You can download it here. As I know boost has a similar web part too.

Hope it will help you!

share|improve this answer

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.


share|improve this answer
how ever de-voted it, provide reason for it ! – Please Teach Nov 2 '12 at 10:01
I didn't down vote, but I'd image it's because you suggested a 3rd party tool and you did not mention if you were connected with it in any way nor did you mention if it was paid or free. But that's just a guess. – Robert Kaucher Feb 17 at 13:30

Your Answer


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.