wmi citrix farm session enumeration

This script can be used in more ways than one. For instance say you want to quickly attach to a specific citrix server in your farm, then enumerate the session information remotely from your computer. Assuming you have the appropriate rights on the server and farm, you can quickly enumerate session with this script. The purpose of this script was to provide a compartmentalized example that works. This can easily be broken down into a function and placed as part of a larger block of code or script.

 

Logic is as follows:

  1. Attach to server > strComputer
  2. Attach to WMI namespace - root\citrix
  3. Perform query against MetaFrame_ProcessesInSession
  4. Echo Results to console
  5. To run script - cscript wmi-citrix-session-enumerate.vbs

  Save the following as a vbscript (*.vbs):

 

AttachmentSize
wmi-citrix-session-enumerate.vbs916 bytes