Posts RSS Comments RSS 253 Posts and 411 Comments till now

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
Citrix License Script Ouput

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

5 Responses to “Citrix License Info (using WMI)”

  1. on 29 May 2008 at 9:56 pmDLP

    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?

  2. on 30 May 2008 at 4:58 amtshell

    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

  3. on 21 Feb 2012 at 5:09 pmsam

    I use this ps1 and get the following result:

    PS D:\> .\Get-CitrixLicense.ps1 127.0.0.1

    Product : MPS_ENT_ENABLER
    Model : Server
    Type : Retail
    Installed : 10
    In Use : 0
    Available : 10
    % in use : 0

    Product : MPS_ENT_CCU
    Model : Server
    Type : Retail
    Installed : 10
    In Use : 0
    Available : 10
    % in use : 0

    Would you please explain what is the meaning of “Product” and “Type” which are different from your type, thanks in advance.

  4. on 21 Feb 2012 at 5:24 pmsam

    only see

    LicenseType :
    License type – NFR(Not For Resale), Retail, Eval(Evaluation), and TP(Technology Preview)á

  5. on 21 Feb 2012 at 5:39 pmsam

    sorry, i see the answer. 🙂

Trackback this post | Feed on Comments to this post

Leave a Reply

You must be logged in to post a comment.