|
|
|
start date: Tue, 07 Aug 2007 14:36:25 -0700,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Homer
|
|
2
Mark Fitzpatrick
|
|
3
Homer
|
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
Date:Tue, 07 Aug 2007 14:36:25 -0700
Author:
|
Re: How to reset user's password without having to use PasswordRecovery
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(),"mynewpassword);
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Homer" wrote in message
news:1186522585.712374.183340@g12g2000prg.googlegroups.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
>
Date:Tue, 7 Aug 2007 18:20:55 -0500
Author:
|
Re: How to reset user's password without having to use PasswordRecovery
On Aug 7, 4:20 pm, "Mark Fitzpatrick" wrote:
> 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(),"mynewpassword);
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "Homer" wrote in message
>
> news:1186522585.712374.183340@g12g2000prg.googlegroups.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.
Date:Wed, 08 Aug 2007 07:30:57 -0700
Author:
|
|
|