469,645 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

How to reset user's password without having to use PasswordRecovery

Hi,

I want to be able to reset a user's password and I do not want to use
the PasswordRecovery control to reset and email it to the user. A
while back, I thought I'd read an article that mentioned about
resetting password using the Website Administration Tool. I could not
find such option in WSAT. Please help!

Thanks,
Jon

Aug 7 '07 #1
2 13135
The MembershipUser object has a ChangePassword method. It also has a
ResetPassword method, but the ResetPassword will generate one randomly. What
you can do though is obtain an instance of the user via their username

MembershipUser user = System.Web.Security.Membership.GetUser(username);
To change the password you need to know the old password, though if you call
resetpassword it will return the newly reset password string so you can do:

user.ChangePassword(user.ResetPassword(),"mynewpas sword);

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Homer" <Ho*******@gmail.comwrote in message
news:11**********************@g12g2000prg.googlegr oups.com...
Hi,

I want to be able to reset a user's password and I do not want to use
the PasswordRecovery control to reset and email it to the user. A
while back, I thought I'd read an article that mentioned about
resetting password using the Website Administration Tool. I could not
find such option in WSAT. Please help!

Thanks,
Jon

Aug 7 '07 #2
On Aug 7, 4:20 pm, "Mark Fitzpatrick" <markf...@fitzme.comwrote:
The MembershipUser object has a ChangePassword method. It also has a
ResetPassword method, but the ResetPassword will generate one randomly. What
you can do though is obtain an instance of the user via their username

MembershipUser user = System.Web.Security.Membership.GetUser(username);

To change the password you need to know the old password, though if you call
resetpassword it will return the newly reset password string so you can do:

user.ChangePassword(user.ResetPassword(),"mynewpas sword);

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Homer" <HomerS...@gmail.comwrote in message

news:11**********************@g12g2000prg.googlegr oups.com...
Hi,
I want to be able to reset a user's password and I do not want to use
the PasswordRecovery control to reset and email it to the user. A
while back, I thought I'd read an article that mentioned about
resetting password using the Website Administration Tool. I could not
find such option in WSAT. Please help!
Thanks,
Jon- Hide quoted text -

- Show quoted text -
Thank you Mark. I'll implement your suggestion now.

Aug 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jefferson Cowart | last post: by
1 post views Thread by kashifsulemani | last post: by
2 posts views Thread by Kleber | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.