I am trying to configure a script in ps that gets me data from the citrix license server. I need it to output the license count, usage and the expiration date of the license. I cant seem to get it to work as i dont know the correct property of the expiration object name.
I currently have it set up like this:
$LicenseData | select-object pld -unique | foreach {
$CurrentLicenseInfo = "" | Select-Object License, Count, Usage, pctUsed, Alert, Expiry
$CurrentLicenseInfo.License = $_.pld
$CurrentLicenseInfo.Count = ($LicenseData | where-object {$_.PLD -eq $CurrentLicenseInfo.License } | measure-object -property Count -sum).sum
$CurrentLicenseInfo.Usage = ($LicenseData | where-object {$_.PLD -eq $CurrentLicenseInfo.License } | measure-object -property InUseCount -sum).sum
$CurrentLicenseInfo.Expiry = ($LicenseData | where-object {$_.PLD -eq $CurrentLicenseInfo.License } | measure-object Expiry -sum).sum
$CurrentLicenseInfo.pctUsed = [Math]::Round($CurrentLicenseInfo.Usage / $CurrentLicenseInfo.Count * 100,2)
$CurrentLicenseInfo.Alert = ($CurrentLicenseInfo.pctUsed -gt $UsageAlertThreshold)`
Im not sure if i have to use the Get-date format instead or have to have the property name. I cant find this info in the citrix license server documentation. The purpose of the script is to obtain the citrix license usage including the expiration which does show if i use the lmutil lmstat tool. Im a bit rusty so any advice was be appreciated.
question from:
https://stackoverflow.com/questions/65852276/what-is-the-correct-format-for-the-expiration-date-in-the-citrix-license-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…