How do I reset the default users?

From WebWatchBotWiki
Jump to: navigation, search

The following script will remove the admin user and then add it back in. Once you can log in, you should go to "user administration" to find out if your other users are present.

The script will create the admin user again: username: admin password: admin


Please open SSMS (SQL Server Management Studio), select "New Query", select the WebWatchBot database from the database dropdown. Copy the following into the query editor, and then execute:

DECLARE	@return_value int,
@NumTablesDeletedFrom int
EXEC	@return_value = [dbo].[aspnet_Users_DeleteUser]
@ApplicationName = N'/',
@UserName = N'admin',
@TablesToDeleteFrom = 3,
@NumTablesDeletedFrom = @NumTablesDeletedFrom OUTPUT
SELECT	@NumTablesDeletedFrom as N'@NumTablesDeletedFrom'
SELECT	'Return Value' = @return_value
GO

if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO
 CREATE PROCEDURE w1 @p1 [uniqueidentifier],@p2 [uniqueidentifier],@p3 [nvarchar] (128),@p4 [int],@p5 [nvarchar] (128),@p6 [nvarchar] (16),@p7 [nvarchar] (256),@p8 [nvarchar] (256),@p9 [nvarchar] (256),@p10 [nvarchar] (128),@p11 [bit],@p12 [bit],@p13 [datetime],@p14 [datetime],@p15 [datetime],@p16 [datetime],@p17 [int],@p18 [datetime],@p19 [int],@p20  [datetime],@p21 [ntext]
AS
 INSERT INTO [dbo].[aspnet_Membership] ([ApplicationId],[UserId],[Password],[PasswordFormat],[PasswordSalt],[MobilePIN],[Email],[LoweredEmail],[PasswordQuestion],[PasswordAnswer],[IsApproved],[IsLockedOut],[CreateDate],[LastLoginDate],[LastPasswordChangedDate],[LastLockoutDate],[FailedPasswordAttemptCount],[FailedPasswordAttemptWindowStart],[FailedPasswordAnswerAttemptCount],[FailedPasswordAnswerAttemptWindowStart],[Comment]) VALUES (@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8,@p9,@p10,@p11,@p12,@p13,@p14,@p15,@p16,@p17,@p18,@p19,@p20,@p21)
GO

-- Admin
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Membership] WHERE [UserId]='6367DF22-F7D5-49BD-97D4-FA28904AE1F8')
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','6367DF22-F7D5-49BD-97D4-FA28904AE1F8','qGiPwBqpmRDamNK7ksodnoxZtic=',1,'4F6sGwrd7t3SJeDsbYeXlg==',NULL,'changeme','changeme','Mothers Maiden Name','yCObl8jrHKSII/thgOi5s+FmTGg=',1,0,'2006-10-07 13:12:11.000','2007-12-16 20:40:33.577','2007-01-10 13:08:41.813','1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',NULL
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Membership] WHERE [UserId]='D01A0EC9-AF94-4DC2-98FB-C6543EFDB766')
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','D01A0EC9-AF94-4DC2-98FB-C6543EFDB766','KOHR5suEl2GvbU9bC1N8vDqhEso=',1,'Vnn2GE2dQ3iT+3FcVQlY4Q==',NULL,'changeme','changeme','Mothers Maiden Name','DFH/N4+9dUrM0jWRhDFL/21hmg0=',1,0,'2006-10-07 13:50:44.000','2007-02-03 20:32:28.923','2006-10-07 13:50:44.000','1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',NULL
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Membership] WHERE [UserId]='5FBF4B12-9F2D-4150-9AF2-3523FCECC76E')
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','5FBF4B12-9F2D-4150-9AF2-3523FCECC76E','QFen6Kg6UaX5JxnrjJ8FPDuzyww=',1,'vaNgFQSnuiqa5zmRWTVVgw==',NULL,'changeme','changeme','Mothers Maiden Name','AfiwXr80FhQfTaPdq+TD6kAIJfM=',1,0,'2006-10-07 12:51:01.000','2007-02-06 15:44:19.710','2006-10-07 12:51:01.000','1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',0,'1754-01-01 00:00:00.000',NULL

GO
if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO
CREATE PROCEDURE w1 @p1 [uniqueidentifier],@p2 [uniqueidentifier],@p3 [nvarchar] (256),@p4 [nvarchar] (256),@p5 [nvarchar] (256)
AS
INSERT INTO [dbo].[aspnet_Roles] ([ApplicationId],[RoleId],[RoleName],[LoweredRoleName],[Description]) VALUES (@p1,@p2,@p3,@p4,@p5)
GO

IF NOT EXISTS ( SELECT 1 FROM [aspnet_Roles] WHERE [RoleId]='DF281A50-27DD-4ECE-91C7-DCD47C5E879C' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','DF281A50-27DD-4ECE-91C7-DCD47C5E879C','Administrators','administrators',NULL
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Roles] WHERE [RoleId]='69B8F949-7BCF-4663-A336-4DF8386478CF' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','69B8F949-7BCF-4663-A336-4DF8386478CF','Users','users',NULL
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Roles] WHERE [RoleId]='F07C2BA8-B2AD-4A71-B749-36E7ADF893E9' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','F07C2BA8-B2AD-4A71-B749-36E7ADF893E9','Viewers','viewers',NULL
GO
if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO
CREATE PROCEDURE w1 @p1 [nvarchar] (128),@p2 [nvarchar] (128),@p3 [bit]
AS
INSERT INTO [dbo].[aspnet_SchemaVersions] ([Feature],[CompatibleSchemaVersion],[IsCurrentVersion]) VALUES (@p1,@p2,@p3)
GO

IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='common' )
EXEC w1 'common','1',1
IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='health monitoring' )
EXEC w1 'health monitoring','1',1
IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='membership' )
EXEC w1 'membership','1',1
IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='personalization' )
EXEC w1 'personalization','1',1
IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='profile' )
EXEC w1 'profile','1',1
IF NOT EXISTS ( SELECT 1 FROM [aspnet_SchemaVersions] WHERE [Feature]='role manager' )
EXEC w1 'role manager','1',1
GO
if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO
CREATE PROCEDURE w1 @p1 [uniqueidentifier],@p2 [uniqueidentifier],@p3 [nvarchar] (256),@p4 [nvarchar] (256),@p5 [nvarchar] (16),@p6 [bit],@p7 [datetime]
AS
 INSERT INTO [dbo].[aspnet_Users] ([ApplicationId],[UserId],[UserName],[LoweredUserName],[MobileAlias],[IsAnonymous],[LastActivityDate]) VALUES (@p1,@p2,@p3,@p4,@p5,@p6,@p7)
GO
 -- Admin
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Users] WHERE [UserId]='6367DF22-F7D5-49BD-97D4-FA28904AE1F8' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','6367DF22-F7D5-49BD-97D4-FA28904AE1F8','admin2','admin',NULL,0,'2007-12-16 20:40:33.577'
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Users] WHERE [UserId]='D01A0EC9-AF94-4DC2-98FB-C6543EFDB766' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','D01A0EC9-AF94-4DC2-98FB-C6543EFDB766','user1','user1',NULL,0,'2007-02-03 20:32:28.923'
IF NOT EXISTS ( SELECT 1 FROM [aspnet_Users] WHERE [UserId]='5FBF4B12-9F2D-4150-9AF2-3523FCECC76E' )
EXEC w1 'C1D60BBA-5A1D-4D5F-BB00-C82644DD0D1A','5FBF4B12-9F2D-4150-9AF2-3523FCECC76E','viewer','viewer',NULL,0,'2007-02-06 15:44:19.710'
GO
if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO
CREATE PROCEDURE w1 @p1 [uniqueidentifier],@p2 [uniqueidentifier]
AS
INSERT INTO [dbo].[aspnet_UsersInRoles] ([UserId],[RoleId]) VALUES (@p1,@p2)
GO
-- Admin
IF NOT EXISTS ( SELECT 1 FROM [aspnet_UsersInRoles] WHERE [UserId]='6367DF22-F7D5-49BD-97D4-FA28904AE1F8')
EXEC w1 '6367DF22-F7D5-49BD-97D4-FA28904AE1F8','DF281A50-27DD-4ECE-91C7-DCD47C5E879C'
IF NOT EXISTS ( SELECT 1 FROM [aspnet_UsersInRoles] WHERE [UserId]='D01A0EC9-AF94-4DC2-98FB-C6543EFDB766')
EXEC w1 'D01A0EC9-AF94-4DC2-98FB-C6543EFDB766','69B8F949-7BCF-4663-A336-4DF8386478CF'
IF NOT EXISTS ( SELECT 1 FROM [aspnet_UsersInRoles] WHERE [UserId]='5FBF4B12-9F2D-4150-9AF2-3523FCECC76E')
EXEC w1 '5FBF4B12-9F2D-4150-9AF2-3523FCECC76E','F07C2BA8-B2AD-4A71-B749-36E7ADF893E9'

GO
if exists (select * from dbo.sysobjects where id = object_id(N'w1') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE w1
GO