Reset username password on eService

Mar 16, 2010 at 8:34 PM

Is it possible to reset a user so they can be sent the login details again from clean. We have a case where  users who cannot remember the answer to their secret questions etc, so would like to "reset" them to start again.

Thanks

Mar 17, 2010 at 1:02 PM
Edited Mar 17, 2010 at 1:09 PM

Below is a script that we have used in the past to reset user accounts who could not reset their password.  WARNING:  This involves SQL Scripts and you MUST take SQL backups of your <org>_MSCRM and ASPNETDB database before using these.  Also, you must be very familiar with SQL Scripts as well.  If you are not familiar with SQL, then I would not try attempting using the fix below.

First we need to run the following statements on the <Org>_MSCRM database …

 Please highlight the appropriate sections before executing the statement 

 

--Run the statement below to get to the right database, replace <orgname> with your oganization name.

use <orgname>_MSCRM 

 

-- 1) Use the select statement below to figure out the specific contact and contactid that you need

select contactid, fullname, accountidname, emailaddress1, msa_eservicesaccesslevel, msa_eservicesaccesslevelname, msa_webuser, msa_webusername, * from filteredcontact where fullname = 'Sevenants, Joe' 

 

-- 2) Set @contact to be the contactid of the contact that you need

DECLARE @contact as UNIQUEIDENTIFIER

set @contact = 'F858E72B-2D31-4C5B-BEE8-8AA8DFBD423B' 

select contactid, fullname, accountidname, msa_eservicesaccesslevel, msa_eservicesaccesslevelname, msa_webuser, msa_webusername, * from filteredcontact where contactid = @contact

 

-- 3) Set the eservice level - Don't forget to update the @contact variable

DECLARE @contact as UNIQUEIDENTIFIER

set @contact = 'F858E72B-2D31-4C5B-BEE8-8AA8DFBD423B'

update contact set msa_webuser = 0 where contactid = @contact

update contact set msa_eservicesaccesslevel = 1 where contactid = @contact 

 

 Second, we need to run the following statements on the aspnetdb database …            

 Please highlight the appropriate sections before executing the statement

 USE aspnetdb

 -- 1) Find the user from their email address

DECLARE @email as NVARCHAR(256)

set @email = 'JSevenants@hotmail.com'

select * from dbo.aspnet_Membership where email = @email

 

-- 2) Using the UserID from the results above, we need to delete from the tables below - set @User to the UserID that is correct

 DECLARE @user as UNIQUEIDENTIFIER

 set @user = 'BBAF8E74-6C56-47B0-B6B9-C5D6B20F8213'

 delete from dbo.aspnet_Membership where Userid = @user

 delete from dbo.aspnet_Profile where Userid = @user

 delete from dbo.aspnet_Users where Userid = @user

 

Finally, go back into CRM and update the contact record to set their eServices Access Level back to the desired level so that the Welcome email is generated again via the CRM Workflow.