• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4233
  • Last Modified:

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.
0
BlurryBrian
Asked:
BlurryBrian
1 Solution
 
pfcjokerCommented:
MFCOM can provide what you are looking for install MFCOM for 4.5 (or 5.0 if you want, it's backwards compatible) - http://community.citrix.com/display/xa/XenApp+SDK+4.5 (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.




<package>
    <job id="citrixadmincheck">
 
        <comment>
	Test Script for seeing if current user is a Citrix admin
        </comment>
        <runtime>
            <description>
                Am I a Citrix admin?
            </description>
            <example>
                CScript //nologo amiadmin.wsf
            </example>
  
        </runtime>
        <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.
            '
 
            theFarm.Initialize(MetaFrameWinFarmObject)
            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 ""
 
        </script>
 
    </job>
 
</package>

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now