admin管理员组文章数量:1130349
- Windows查看激活状态关键代码
通过windows server 自带的PowerShell来执行
Get-WmiObject SoftwareLicensingProduct | Select-Object -Property Description, LicenseStatus | findstr "Operating System"|findstr "1$"
Get-WmiObject SoftwareLicensingProduct | Where-Object { $_.LicenseStatus -eq 1 } | Select-Object -ExpandProperty Description
Windows Operating System - Windows® 7, RETAIL channel
- 写出来的巡检脚本
如果License状态是正常的,就返回1,否则返回0
$res = Get-WmiObject SoftwareLicensingProduct | Where-Object { $_.LicenseStatus -eq 1 } | Select-Object -ExpandProperty Description
if ($res -ne $null)
{
Write-Output "LicenseStatus 1"
}
else
{
Write-Output "LicenseStatus 0"
}
- Windows查看激活状态关键代码
通过windows server 自带的PowerShell来执行
Get-WmiObject SoftwareLicensingProduct | Select-Object -Property Description, LicenseStatus | findstr "Operating System"|findstr "1$"
Get-WmiObject SoftwareLicensingProduct | Where-Object { $_.LicenseStatus -eq 1 } | Select-Object -ExpandProperty Description
Windows Operating System - Windows® 7, RETAIL channel
- 写出来的巡检脚本
如果License状态是正常的,就返回1,否则返回0
$res = Get-WmiObject SoftwareLicensingProduct | Where-Object { $_.LicenseStatus -eq 1 } | Select-Object -ExpandProperty Description
if ($res -ne $null)
{
Write-Output "LicenseStatus 1"
}
else
{
Write-Output "LicenseStatus 0"
}
版权声明:本文标题:【生产实测有效】Windows命令行查看激活状态脚本 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1755033472a2756618.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论