Customers looking to give an Admin Role to a specific User for our Workbench Server Product, but do not have the ability to add them on the Server has the option to run a T-SQL script on the PragmaticWebAdministration database. This will add the specified UserName to the Admin role for Workbench Server.
Step 1: Open SQL Server Management Studio.
Step 2: Expand the PragmaticWebAdministration database.
Step 3: Go into the Users table and find the UserName of the person you would like to have Admin rights on the Server Product.
Step 4: Open a new query window and Copy/Paste the T-SQL Script from below.
DECLARE @AdminRoleId NVARCHAR(128)
DECLARE @UserId NVARCHAR(128)
SELECT TOP(1) @AdminRoleId = r.[Id] FROM [dbo].[Roles] r WHERE r.[Name] = 'Administrators'
SELECT TOP(1) @UserId = u.[Id] FROM [dbo].[Users] u WHERE u.[UserName] = 'UserNameHere'
IF ISNULL(@AdminRoleId, '') <> '' AND ISNULL(@UserId, '') <> ''
INSERT INTO [dbo].[UserRoles] ([UserId], [RoleId]) VALUES (@UserId, @AdminRoleId)
Step 5: Copy/Paste the UserName from Step 3 into the “UserNameHere” on the fifth line of the T-SQL script.
Step 6: Execute the T-SQL Script.
Step 7: Access the Server Product URL and confirm that User can see the Admin Gear on the far right (as shown below)