It has been a long time ago since I last created a new post. Time for a new one! I’ve created a series of posts about starting ICA connections programmatically (by using PowerShell). These posts were about the client-side of ICA connections; in this series, I will talk about using the Windows Management Instrumation (WMI) which allows you to monitor your XenApp environment.
While Citrix did document something on eDocs, it’s not a highly-documented feature. This feature is actually quite useful when, for example, monitoring your environment.
This post is not about WMI basics, so I expect that you already know what WMI is and how it’s used. I’ll be using PowerShell as an example, but any scripting/programming language can be used to access the WMI classes. To get more information about WMI in general, visit the Microsoft MSDN site.
The Citrix WMI namespace
Citrix provided two types of WMI providers; one provider for Citrix Licensing and one provider for XenApp. In this part, I will focus on the XenApp WMI provider, which is available under the following namespace:
This namespace is available on your XenApp servers. Note that this namespace is the root of others:
We will be focussing on the “root\citrix” namespace. To get a list of all classes available in this namespace, we will be using PowerShell. I chose PowerShell for this, since it provides easy methods to get information about WMI classes and namespaces. The easiest way to use the WMI provider, is to log in to one of your XenApp servers as an administrator and start PowerShell. To get the list of classes, execute this PoSh command:
Get-WmiObject -Namespace root\citrix -List
This will output the complete list of available classes within the “root\citrix” namespace. If you would be using this from a remote location (eg. your management workstation), you have to provide the XenApp server name:
Get-WmiObject -ComputerName XENAPPSERVER -Namespace root\citrix -List
Keep in mind that you need correct permission to be able to access the WMI provider. To define the correct credentials, you can use the “-Credential” argument in PowerShell:
Get-WmiObject -Credential (Get-Credential) -ComputerName XENAPPSERVER -Namespace root\citrix -List
This will popup a nice credential input form:
If your command executed without errors, you will see the complete list of classes available under the “root\citrix” namespace. The useful classes are these:
In the next part of this series, I will go more in-depth about some of these classes. Hope this has been useful for you. If you have any questions/remarks, feel free to leave a comment or contact me at email@example.com.
Note that these WMI classes are for XenApp 6.5. If you’re using a different version of XenApp, the classes list may differ.
That was it for the WMI basics. In part 2, I will cover monitoring XenApp servers.