我是powershell的新手,正在尝试编写一个程序来获取众多服务器的产品密钥。
我遍历服务器名称并尝试执行以下代码,但在标题中得到错误
$LicenseInfo = Get-WmiObject -Class SoftwareLicensingProduct -ComputerName $target -Credential $cred | `
Where-Object { $_.PartialProductKey -and $_.ApplicationID -eq "55c92734-d682-4d71-983e-d6ec3f16059f" } | Select-Object PartialProductKey, Description, ProductKeyChannel, @{ N = "LicenseStatus"; E = { $lstat["$($_.LicenseStatus)"] } } 任何帮助都将不胜感激
发布于 2018-10-11 22:38:40
这个错误是非常具体的。您的目标计算机是否没有可用的此类?根据docs.microsoft.com for SoftwareLicensingProduct
支持的最低客户端: Windows 7
支持的最低服务器: Windows Server 2008 R2
https://stackoverflow.com/questions/52762473
复制相似问题