powershell - 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 工具的过期时间。我有点生疏,所以任何建议都值得赞赏。
解决方案
推荐阅读
- excel - 连接到 Office 2016 时数据库提供程序名称不存在
- javascript - 如何使用 React 选择兄弟元素?
- python - 如何将角色列入白名单以防止被禁止
- jquery - 如何在鼠标移动时移动图像?
- python - 将不带引号的列表元素(即字符串类型)转换为整数元素列表
- html - 如何使用 ESp8266 Webserver 从客户端设备读取 cookie?
- swift - SwiftUI 矩形占用了错误的空间
- reactjs - SyntaxError:无法在测试文件中的模块外部使用导入语句
- mongodb - 运行 mongoimport 时出现 authenticationDatabase 错误
- python - 我需要将用户输入变量作为此列表传递,例如: [1, 3, 6, 4, 1, 2] 在下面的 python 程序中。有人可以帮我吗