Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Citrix Admin from Command Line

Posted on 2009-04-02
1
Medium Priority
?
4,219 Views
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.
0
Comment
Question by:BlurryBrian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
pfcjoker earned 2000 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) - 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Citrix XenDesktop 7.6 Citrix Policies Graphics
Know what services you can and cannot, should and should not combine on your server.
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.

636 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