首页 > 解决方案 > citrix 许可证服务器中到期日期的正确格式是什么?

问题描述

我正在尝试在 ps 中配置一个脚本,以从 citrix 许可证服务器获取数据。我需要它来输出许可证的数量、使用情况和许可证的到期日期。我似乎无法让它工作,因为我不知道过期对象名称的正确属性。

我目前的设置是这样的:

$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)`

我不确定我是否必须改用 Get-date 格式或必须具有属性名称。我在 citrix 许可证服务器文档中找不到此信息。该脚本的目的是获取 citrix 许可证使用情况,包括是否显示我是否使用 lmutil lmstat 工具的过期时间。我有点生疏,所以任何建议都值得赞赏。

标签: powershellcitrix

解决方案


推荐阅读