Citrix Admin from Command Line

Posted on 2009-04-02
Last Modified: 2013-11-21
For some reason today I am not able to log into the Citrix Access Management Console and run the discovery process.  I receive the following message:

"This user account is not an administrator of this farm, or there was a problem contacting the data store. Check that the data store server for the Citrix Presentation Server farm is online, and verify that your account is configured and enabled as an administrator on the farm."

How can I verify that this user is a Citrix administrator without logging into the AMC?  Is there a way to check the Citrix Farm administrators from the command line?

We are running Citrix Presentation Server 4.5.
Question by:BlurryBrian
1 Comment
LVL 11

Accepted Solution

pfcjoker earned 500 total points
ID: 24055096
MFCOM can provide what you are looking for install MFCOM for 4.5 (or 5.0 if you want, it's backwards compatible) - (not needed if running script from the server itself, this is just if you want to run it from your desktop).

Save the code below to a file remotely if you installed mfcom and registered it to your server on the last screen of the server, or save it on the server as amiadmin.wsf

open a command prompt, run cscript //nologo amiadmin.wsf and it should display the farm name if you are an admin, if not it will tell you you aren't.


    <job id="citrixadmincheck">


	Test Script for seeing if current user is a Citrix admin




                Am I a Citrix admin?



                CScript //nologo amiadmin.wsf




        <reference object="MetaFrameCOM.MetaFrameFarm"/>

        <script language="VBScript">


            Dim theFarm


            ' Create MetaFrameFarm object


            Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")

            if Err.Number <> 0 Then

                WScript.Echo "Can't create MetaFrameFarm object"

                WScript.Echo "(" & Err.Number & ") " & Err.Description

                WScript.Echo ""

                WScript.Quit Err.Number

            End if


            ' Initialize the farm object.



            if Err.Number <> 0 Then

                WScript.Echo "Can't  Initialize MetaFrameFarm object"

                WScript.Echo "(" & Err.Number & ") " & Err.Description

                WScript.Echo ""

                WScript.Quit Err.Number

            End if


            ' Are you Citrix Administrator?


            if theFarm.WinFarmObject.IsCitrixAdministrator = 0 then

                WScript.Echo "You must be a Citrix admin to run this script" 

                WScript.Echo ""

                WScript.Quit 0

            End If


            ' Print out the farm name.


            WScript.Echo "MetaFrame Farm Name: " & theFarm.FarmName

            WScript.Echo ""




Open in new window


Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Citrix XenDesktop, Citrix Studio, Citrix Policies, Citrix XenApp
Citrix XenDesktop 7.6 Citrix Policies Graphics
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now