Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
464 views
in Technique[技术] by (71.8m points)

powershell - What is the correct format for the expiration date in the citrix license server?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...