Adding the Local Administrator Account as a Full XenApp Farm Administrator Using Microsoft PowerShell

Scenario: You are locked out of the Delivery Services Console or AppCenter or AppCentre and you need in.  How?  There is a tool called SlimJim you can use or you can use one line of PowerShell.  Obviously, I would prefer PowerShell over an unsupported utility even if the utility works.

Here is a screenshot of my XenApp 6.5 AppCenter showing there is no local administrator account.

Note: My domain is Webster.

AppCenter with no Local Administrator

AppCenter with no Local Administrator

The first thing I do is open a PowerShell session.  Next I type in add-pssnapin *citrix* to load the Citrix XenApp PowerShell cmdlets.  Next I type in hostname to verify the name of the local XenApp server.  Then I type

new-xaadministrator LocalServerName\administrator -Enabled $True -AdministratorType Full

to add the XenApp server’s local administrator account as a Full Farm Administrator.  Since the local administrator account has the same name on every server this effectively adds the local administrator from every XenApp server as a Full Farm Administrator.

PowerShell Session

PowerShell Session

Finally I verify in AppCenter the account was added.

AppCenter with Local Administrator as a Full Farm Administrator

AppCenter with Local Administrator as a Full Farm Administrator

To verify the local administrator account had access to AppCenter, I logged in as the local administrator and ran AppCenter.

Logged in as Local Administrator

Logged in as Local Administrator

Running AppCenter as Local Administrator

Running AppCenter as Local Administrator

Granted, you will not have access to AppCenter of the Delivery Service Console but this is just to show you this one line of PowerShell works to add the local administrator account into your XenApp Farm as a Full Farm Administrator.  I only tested this on XenApp 6.5 but the same PowerShell command should work on XenApp 6, XenApp 5 for Server 2003 and XenApp 5 for Server 2008.

Update 30-Jan-2014: I have now tested this on XenApp 5 for Server 2003, XenApp 5 for Server 2008, XenApp 6.0 and XenApp 6.5.

Thanks

Webster

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

6 Responses to “Adding the Local Administrator Account as a Full XenApp Farm Administrator Using Microsoft PowerShell”

  1. Venkat Says:

    Hello,

    The admin in the organization left and before adding a new admin, the admin account has been removed. Is there any way to add a new admin through a backdoor? We have full windows privilege but wanted to add ourself to xenapp admin.

    Thanks.
    Venkat

    Reply

  2. Jim Says:

    This does not appear to work unless the account executing the command is already a citrix administrator. What do you do if the only account that has administrative privledges is a domain account that has been deleted?

    Reply

  3. Ganesh Says:

    This is cool. Thanks a lot for sharing!

    Reply

Leave a Reply