Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to reset user's password without having to use PasswordRecovery

Reply
Thread Tools

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

 
 
Homer
Guest
Posts: n/a
 
      08-07-2007
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

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      08-07-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
 
 
 
Homer
Guest
Posts: n/a
 
      08-08-2007
On Aug 7, 4:20 pm, "Mark Fitzpatrick" <(E-Mail Removed)> 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(),"mynewpas sword);
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
>
> "Homer" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Change a users password without knowing the old password nor the answer to the password question AAaron123 ASP .Net 1 01-16-2009 02:56 PM
Changing a users password without knowing the old password nor the answer to the password question AAaron123 ASP .Net 2 01-16-2009 02:08 PM
Password Reset formatting in PasswordRecovery rory.groves@gmail.com ASP .Net 1 04-09-2007 07:38 PM
CISCO 7XX / 761 password reset or reset to factory defaults Philipp Flesch Cisco 3 06-18-2006 07:47 PM



Advertisments