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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
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.

911 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