Monitor Citrix Licenses In Use With Powershell

# Setup Variables
$Total = 0
$InUse = 0
$StrHost = "Localhost" 

# Get Citrix licensing Info
$licensePool = gwmi -class "Citrix_GT_License_Pool" -Namespace "Root\CitrixLicensing" -comp $StrHost

$LicensePool | ForEach-Object{ If ($_.PLD -eq "MPS_ADV_CCU"){
    $Total = $Total + $_.Count
    $InUse = $InUse + $_.InUseCount
    }
}

$PercentUsed = [Math]::Round($inuse/$total*100,0)
$Free = [Math]::Round($Total-$Inuse)

echo "Total: ",$Total
echo "In Use: ",$InUse
echo "Free: ",$Free
echo "Percent Used: ", $PercentUsed
VN:F [1.9.22_1171]
Rating: 6.0/6 (3 votes cast)
Monitor Citrix Licenses In Use With Powershell, 6.0 out of 6 based on 3 ratings

One thought on “Monitor Citrix Licenses In Use With Powershell”

  1. # Get Citrix License info
    $licensePool = Get-WmiObject -Class “Citrix_GT_License_Pool” -ComputerName “localhost” -Namespace “root\CitrixLicensing”
    $licinfo=($licensePool | Select-Object @{n=”Product”;e={$_.PLD}},@{n=”LicenseType”;e={$_.LicenseType}},@{n=”Installed”;e={$_.Count}},@{n=”Used”;e={$_.InUseCount}},@{n=”Free”;e={$_.PooledAvailable}},@{n=”Used%”;e={[Math]::Round((($_.InUseCount/$_.Count)*100),2)}} | Sort-Object Product)
    # Output
    $licinfo | Format-Table -auto
    # Get Total license count
    $tcAvailable=0
    $tcInstalled=0
    foreach ($item in $licinfo)
    {
    $tcAvailable=$tcAvailable + $item.Free
    $tcInstalled=$tcInstalled + $item.Installed
    }
    $perFree

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

Your email address will not be published. Required fields are marked *