Citrix Admin from Command Line

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.
Who is Participating?
pfcjokerConnect With a Mentor Commented:
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.