Hi, our version is 15.1.1.3286.
I accidently deleted 'guest' account and now I cannot use imis desktop to login, it complains:
the application server version may not match the database version.
Browsing imis15 site also generates error:
Asi.Security.UserValidationException: Validation Failed
And idea how to fix this issue?
Thanks.
Recreate GUEST Account script
Run this SQL script in SQL Server Management Studio (or Query Analyzer if you use SQL2K) pointing at your iMIS DB:
-- Create GUEST account if one doesn't already exist DECLARE @tempID int DECLARE @tempAddressNum int DECLARE @now datetime SET @now = GETDATE() IF NOT EXISTS (SELECT 1 FROM Name_Security WHERE WEB_LOGIN = 'GUEST') BEGIN SET @tempID = NULL SELECT @tempID = ContactMaster FROM UserMain WHERE UserId = 'GUEST' IF @tempID IS NULL BEGIN EXEC sp_asi_GetCounter Name SELECT @tempID = LAST_VALUE from Counter where COUNTER_NAME = 'Name' END EXEC sp_asi_GetCounter Name_Address SELECT @tempAddressNum = LAST_VALUE from Counter where COUNTER_NAME = 'Name_Address' INSERT INTO [dbo].[Name] ([ID], [LAST_FIRST], [FIRST_NAME], [FULL_NAME], [MEMBER_TYPE], [STATUS], [MAIL_ADDRESS_NUM], [BILL_ADDRESS_NUM], [SHIP_ADDRESS_NUM], [JOIN_DATE], [DATE_ADDED], [LAST_UPDATED], [UPDATED_BY]) VALUES (CAST(@tempID AS varchar(10)), 'GUEST', 'GUEST', 'GUEST', 'NM', 'A', @tempAddressNum, @tempAddressNum, @tempAddressNum, @now, @now, @now, 'MANAGER') INSERT Name_Address (ID, ADDRESS_NUM, PURPOSE, PREFERRED_MAIL, PREFERRED_BILL, PREFERRED_SHIP) VALUES (CAST(@tempID AS varchar(10)), @tempAddressNum, 'Address', 1, 1, 1) INSERT Name_Security (ID, WEB_LOGIN, PASSWORD) VALUES (CAST(@tempID AS varchar(10)), 'GUEST', '') INSERT Name_Fin (ID) VALUES (CAST(@tempID AS varchar(10))) END DECLARE @contactKey uniqueidentifier DECLARE @contactStatusCode int DECLARE @managerKey uniqueidentifier DECLARE @addressCategoryCode int DECLARE @accessKey uniqueidentifier DECLARE @contactTypeKey uniqueidentifier DECLARE @defaultDepartmentGroupKey uniqueidentifier DECLARE @defaultPerspectiveKey uniqueidentifier DECLARE @componentKey uniqueidentifier -- Look-up some required values SELECT @contactKey = [UserKey] FROM [dbo].[UserMain] WHERE [UserId] = 'GUEST' IF (@contactKey IS NULL) BEGIN SELECT @contactKey = [ContactKey] from [dbo].[ContactMain] WHERE [FullName] = 'GUEST' IF (@contactKey IS NULL) SET @contactKey = newid() END SELECT @contactStatusCode = [ContactStatusCode] FROM [dbo].[ContactStatusRef] WHERE [ContactStatusDesc] = 'Active' SELECT @managerKey = [UserKey] FROM [dbo].[UserMain] WHERE [UserId] = 'MANAGER' SELECT @addressCategoryCode = [AddressCategoryCode] from [dbo].[AddressCategoryRef] WHERE [AddressCategoryName] = 'Mail' SELECT @accessKey = [ProtectedAccessKey] FROM [dbo].[AccessArea] WHERE [Name] = 'Everyone Full Control' SELECT @contactTypeKey = [ContactTypeKey] FROM [dbo].[ContactTypeRef] WHERE [ContactTypeDesc] = 'Individual' SELECT @defaultDepartmentGroupKey = [GroupKey] FROM [dbo].[GroupMain] gm INNER JOIN [dbo].[GroupTypeRef] gt ON gm.GroupTypeKey = gt.GroupTypeKey WHERE gm.[Name] = 'Administrative' AND gt.[GroupTypeName] = 'Department' SELECT @defaultPerspectiveKey = [PerspectiveKey] FROM [dbo].[Perspective] WHERE [PerspectiveName] = 'Administrative' SELECT @componentKey = [ComponentKey] FROM [dbo].[ComponentRegistry] WHERE [Name] = 'Individual' AND [InterfaceName] = 'BusinessController' -- Insert into ContactMain if not present IF NOT EXISTS (SELECT 1 FROM [dbo].[ContactMain] WHERE [FullName] = 'GUEST') BEGIN INSERT INTO [dbo].[UniformRegistry] (UniformKey, ComponentKey) VALUES (@contactKey, @componentKey) INSERT INTO [dbo].[ContactMain] ([ContactKey], [ContactStatusCode], [FullName], [SortName], [IsInstitute], [NoSolicitationFlag], [SyncContactID], [UpdatedOn], [UpdatedByUserKey], [IsIDEditable], [ID], [PreferredAddressCategoryCode], [IsSortNameOverridden], [AccessKey], [CreatedByUserKey], [CreatedOn], [TextOnlyEmailFlag], [ContactTypeKey], [OptOutFlag]) VALUES (@contactKey, @contactStatusCode, 'GUEST', 'GUEST', 0, 0, @tempID, @now, @managerKey, 0, @tempID, @addressCategoryCode, 0, @accessKey, @managerKey, @now, 0, @contactTypeKey, 0) END -- Insert into Individual if not present IF NOT EXISTS (SELECT 1 FROM [dbo].[Individual] WHERE [FirstName] = 'GUEST') BEGIN INSERT INTO [dbo].[Individual] ([ContactKey], [PrefixCode], [FirstName], [MiddleName], [LastName], [SuffixCode], [Designation], [Informal], [Gender]) VALUES (@contactKey, '', 'GUEST', '', '', '', '', '', '') END -- Insert into UserMain if not present IF NOT EXISTS (SELECT 1 FROM [dbo].[UserMain] WHERE [UserId] = 'GUEST') BEGIN INSERT INTO [dbo].[UserMain] ([UserKey], [ContactMaster], [UserId], [IsDisabled], [EffectiveDate], [ExpirationDate], [UpdatedByUserKey], [UpdatedOn], [CreatedByUserKey], [CreatedOn], [DefaultDepartmentGroupKey], [DefaultPerspectiveKey], [ProviderKey]) VALUES (@contactKey, @tempID, 'GUEST', 0, '20000101 00:00:00', NULL, @managerKey, @now, @managerKey, @now, @defaultDepartmentGroupKey, @defaultPerspectiveKey, NULL) END GO