How to add one new Citrix full administrator via database

How to add one new Citrix full administrator via database

book

Article ID: CTX461330

calendar_today

Updated On:

Description

The only Citrix full administrator account may be removed on AD by mistake. All users cannot access or manage Studio. We may need to add a new Citrix full administrator account by modifying the database.


Instructions

Backup database before operation.
1. Get the new admin's SID by running the following PowerShell command on DDC:
$objUser = New-Object System.Security.Principal.NTAccount("domain\adminname")
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.value 

2. Add the admin record into the [DAS].[Administrators] table, there is two way:
    >>Manually edit the table and set 'SID' as admin's SID and 'Enabled' as 'True'
    >>Or use this query to add the admin record
INSERT into DAS.Administrators (Sid, Enabled) VALUES ('admin's SID',1)

3. Use the following query to get the XD Full Administrator's RoleId and XD All Objects ScopeId    
    SELECT Id FROM [YourDBHere].[DAS].[Roles] WHERE "Name" like 'Full Administrator'    
    SELECT Id FROM [YourDBHere].[DAS].[Scopes] WHERE "Description" like 'All Objects'      
then we got:      
     DF20D111-4D0B-4502-AD12-5E8B3AFC62A1      
     00000000-0000-0000-0000-000000000000 

4. Use the following script to invoke the stored procedure [DAS].[AddRight] to add the admin's right  
USE [YourDBHere]  
GO  
DECLARE    @return_value int  
EXEC    @return_value = [DAS].[AddRight]  
@Admin =    'S-1-5-21-3252325344-3963628825-2107194750-1106',  
@Role = 'DF20D111-4D0B-4502-AD12-5E8B3AFC62A1',  
@Scope = '00000000-0000-0000-0000-000000000000'  
SELECT    'Return Value' = @return_value  
GO

Issue/Introduction

It can add and delegate administration through the database, and backup the database before operation.