• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
XenApp Developer Network

List XenApp Editions in CSV format

Description

This sample code uses MFCOM to list the product editions of all servers in the farm. It is based on the servers.wsf example in the XenApp Management Software Development Kit (MPSSDK/MFCOM).

Instructions

  1. Paste the code into a text file
  2. Save the text file as ListServerEditions.wsf
  3. Open a command prompt, navigate to the directory containing the ListServerEditions.wsf script and execute the below command to save the results to a .csv file that an be opened in Excel:

cscript //nologo ListServerEditions.wsf > serverEditions.csv

Download

<Upload the script or the tool and have the URL of the download here>

Code Snippet

<package>
    <job id="ListServerEditions">

        <comment>
        File:           ListServerEditions.wsf
        Description:    List the product editions of all servers in the farm and output in a .csv format for easy opening and sorting in a spreadsheet application.
        Requirements:   WSH 5.5 or higher.
        </comment>
        <runtime>
            <description>
                List the product editions of all servers in the farm and output in a .csv format for easy opening and sorting in a spreadsheet application.
            </description>
            <example>
                CScript //nologo ListServerEditions.wsf > serveEditions.csv
            </example>
 
        </runtime>
        <reference object="MetaFrameCOM.MetaFrameFarm"/>
        <script language="VBScript">
       
            Dim theFarm, aServer, aWinServer

            '
            ' 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

           
            '
            ' Display all servers in the farm.
            '
  
     WScript.Echo "Server,Edition" 
            For Each aServer In theFarm.Servers

                if Err.Number <> 0 Then
                    WScript.Echo "Can't enumerate servers"
                    WScript.Echo "(" & Err.Number & ") " & Err.Description
                    WScript.Echo ""
                    WScript.Quit Err.Number
                End if

             
                '
                ' MetaFrameWinServer object.
                '
                Set aWinServer = aServer.WinServerObject
  ' Print server name and edition - seperated by a ,s
  
  wscript.echo aServer.ServerName & "," & aWinServer.MFWinName
            Next                  
        </script>
    </job>
</package>

Disclaimer

These software applications are provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.

Tags

xenapp codeshare xenapp codeshare Delete
xenapp tools xenapp tools Delete
xenapp scripts xenapp scripts Delete
licensing licensing Delete
mfcom mfcom Delete
visual basic visual basic Delete
vbs vbs Delete
mpssdk mpssdk Delete
xenapp xenapp Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.
Related Links