Windows

跨多個伺服器獲取 slmgr.vbs 輸出和/或 Windows 許可狀態報告

  • September 5, 2020

我有一些我最近獲得所有權的 Windows Server,我正在尋找一份關於如何獲得許可的報告。我知道這是 KMS 和 MAK 許可之間的混合,但我正在嘗試找到一種生成報告的方法,以顯示許可狀態或slmgr.vbs /dli每個伺服器的等效輸出。

所有這些機器都是用 SCCM2012 管理的,所以我認為有辦法從那裡獲取這些資訊,但我找不到。

沒有編寫psexec腳本,有沒有更好的方法來獲取這些數據?

slgmr不是最好的工具。您可以使用Microsoft的VAMT 2.0 工具清點目前作業系統的許可。

如果您正在尋找可以集成的 powershell 中的 doityourself 方法(我是一組開發機器),請嘗試將此作為起點,從 slmgr 提供的字元串中收集基於對象的值。您需要使用 cscript 將輸出輸出到您可以擷取的控制台。

$results=invoke-command "computer1","computer2" {
$license=[ordered] @{};
cscript C:\Windows\System32\slmgr.vbs /dlv all |?{$_ -match ":"} | foreach-object {$row=$_ -split ":";$license.$($row[0])=$row[1]}
new-object -type pscustomobject -property $license
}
$results | Out-GridView

引用自:https://serverfault.com/questions/390970