Citrix License Info (using WMI)
I had several questions about this so I decided I should figure it out and Post. It was surprisingly simple. All I needed was the WMI provider and from there it was cake. If you’re curious how I figured out the WMI namespace I used WMI Explorer from MoW [CLICK HERE To Read about it].
The Output will look like this

Here is the Code
# Get-CitrixLicensing
Param($LicenseServer)
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp $LicenseServer
$licensePool | Select-Object @{n="Product";e={$_.PLD}},
@{n="Model";e={"Server"}},
@{n="Type";e={$_.LicenseType}},
@{n="Installed";e={$_.Count}},
@{n="In Use";e={$_.InUseCount}},
@{n="Available";e={$_.PooledAvailable}},
@{n="% in use";e={($_.InUseCount/$_.Count)*100}}
Param($LicenseServer)
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "ROOT\CitrixLicensing" -comp $LicenseServer
$licensePool | Select-Object @{n="Product";e={$_.PLD}},
@{n="Model";e={"Server"}},
@{n="Type";e={$_.LicenseType}},
@{n="Installed";e={$_.Count}},
@{n="In Use";e={$_.InUseCount}},
@{n="Available";e={$_.PooledAvailable}},
@{n="% in use";e={($_.InUseCount/$_.Count)*100}}


Great script Brandon. Just what I needed. Will you please explain the second part of the script in how you use Select-Object to display the data? How does Select-Object know to grab each “Product” etc and group them together to display?
I used what is referred to as a calculated property. Effectively, you use select-object to “add” a property that doesn’t really exist, but its value is calculated from a script block “{…}.” Here are some good links that talk about calculated properties.
http://bsonposh.com/archives/260
http://bsonposh.com/archives/262
and
http://www.microsoft.com/technet/scriptcenter/resources/pstips/apr08/pstip0425.mspx