SHARE
TWEET

XenDesktop License Check

david62277 May 7th, 2015 (edited) 1,051 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. This script should be run on a license server and replace the yourLIChere in the $certhash and $license variables with the hostname of the license server.  If your license server's name is lic01 then:
  3. $certhash = (get-liccertificate -adminaddress lic01).certhash
  4. $license = Get-LicInventory -AdminAddress lic01 -CertHash $certhash | ?{($_.licensesinuse -ne "0") -and ($_.LocalizedLicenseProductName -notlike "citrix start-up*")}
  5. You could also edit this script to run remotely with Invoke-Command.
  6. #>
  7. #add the snapin
  8. asnp Citrix.Licensing.Admin*
  9. # get the cert hash which is needed for the Get-LicInventory command
  10. $certhash = (get-liccertificate -adminaddress yourLIChere).certhash
  11. # get all the licenses where the licenses are actually being used, and discard the start-up license
  12. $license = Get-LicInventory -AdminAddress yourLIChere -CertHash $certhash | ?{($_.licensesinuse -ne "0") -and ($_.LocalizedLicenseProductName -notlike "citrix start-up*")}
  13. # foreach loop will go through each license record in $license, calculate the usage and spit out the results for you
  14. foreach ($lic in $license) {
  15. $percentused = ("{0:P0}" -f ([math]::round(($lic.licensesinuse / $lic.LicensesAvailable),2))) -replace " ",""
  16. $lic.LocalizedLicenseProductName
  17. write-host "In Use:" $lic.licensesinuse
  18. write-host "Total:" $lic.licensesavailable
  19. $remain = $lic.licensesavailable - $lic.licensesinuse
  20. write-host "Remaining:" $remain
  21. write-host "$percentused Used"
  22. }
  23. <# Results will look like this
  24. Citrix XenDesktop Enterprise
  25. In Use: 208
  26. Total: 300
  27. Remaining: 92
  28. 69% Used
  29. #>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top