Post
by June » Wed Sep 17, 2014 6:12 am
Thank you very much for your replies. You all are very helpful!
Here is the SQL in case someone else may want to do this in the future. These are the tables that are affected. I was able to encrypt a first time password by using the SHA1 encryption tool (Visual Studio).
Please note that there are values you have to replace in the code - values to replace are between the <> AND you need to make sure you want the static values I am passing so - USE CAUTION and analyze. Do not just copy and paste.
-- Add a user to the ac_Users table
INSERT INTO dbo.ac_Users
([StoreId],[UserName],[LoweredUserName],[Email],[LoweredEmail],[PrimaryWishlistId],[IsApproved],[IsAnonymous],[IsLockedOut],[CreateDate],[FailedPasswordAttemptCount],[FailedPasswordAnswerAttemptCount],[TaxExemptionType])
VALUES
(1,'<username>','<username.ToLower>','<email>','<email.ToLower>',0,1,0,0,'2014-08-29 00:10:27.023',0,0,0)
-- Set the user’s group
INSERT INTO [dbo].[ac_UserGroups]
([UserId], [GroupId])
VALUES
(<userid from dbo.ac_Users record insert>,8)
-- Set the user's password to Coleman2*14
INSERT INTO dbo.ac_UserPasswords
([UserId],[PasswordNumber],[Password],[PasswordFormat],[CreateDate],[ForceExpiration])
VALUES
(<userid from dbo.ac_Users record insert>,1,'Jt2MLOhY2oE4jGZou3kvbI3Rgu2xhkCedQ==','SHA1','2014-08-29 00:10:27.023',1)
-- Set the user’s first and last name- WATCH FOR APOSTROPHES IN NAMES!!
INSERT INTO [dbo].[ac_Addresses]
([UserId],[FirstName],[LastName],[Residence],[Validated],[IsBilling])
VALUES
(<userid from dbo.ac_Users record insert>,'<first name>','<last name>',1,0,1)