Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Changing passwords through a web part

  Asked By: Ricardo    Date: Apr 28    Category: Sharepoint    Views: 2163

I wrote a Web Part for Sharepoint Portal 2003 that allows the
user to change his password. It works, as in the password is indeed
changed, but the problem is that instead of reloading the page
afterwards, it instead throws me to a page with a "You cannot view this
area, either because the area no longer exists, or because you do not
have the rights to view this area. To change your rights, contact the
site administrator" message.

Here's my submit code, oldPassword and newPassword are TextFields.
public void changePassword(object sender, EventArgs e)


SPWeb web = SPControl.GetContextWeb(Context);

user = web.CurrentUser;

DirectoryEntry entry = new DirectoryEntry("LDAP://CN=" + user.Name +

user.LoginName.Substring(9), oldPassword.Text);

entry.Invoke("ChangePassword", new object[]{oldPassword.Text,



What's happening here? Do I have to reload the user profile or something
when I change the password programmatically? More importantly, how can I
correct this?



1 Answer Found

Answer #1    Answered By: Raymond Develin     Answered On: Apr 26

That's not a easy work.

There is a third party sharepoint add-on www.sharepointadd-ons.com/sharepoint-password-change-expiration

With customizable e-mail notifications when password is about to expire.

Didn't find what you were looking for? Find more on Changing passwords through a web part Or get search suggestion and latest updates.