问题描述
我正在尝试在 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 工具的到期时间。我有点生疏,因此不胜感激任何建议。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)