存取提供的資料
以下是使用 PowerShell 或 Windows 指令列存取 ESET WMI 資料的幾個範例。其他指令碼語言和工具也可用於存取資料。
Microsoft 從 Windows Server 2012 發佈開始逐步棄用 WMIC,並在 Windows Server 2025 中將其完全移除。因此,WMIC 可能並非在所有作業系統上都可以使用,建議您使用 PowerShell 而不是 WMIC。 |
不含指令碼的命令列
wmic 命令列工具可用來存取各種預先定義或任何自訂的 WMI 類別。
若要顯示與本機產品有關的完整資訊:
wmic /namespace:\\root\ESET Path ESET_Product
若只要顯示本機產品的產品版本號碼:
wmic /namespace:\\root\ESET Path ESET_Product Get Version
若要顯示與遠端機器 (IP 10.1.118.180) 產品有關的完整資訊:
wmic /namespace:\\root\ESET /node:10.1.118.180 /user:Administrator Path ESET_Product
PowerShell
取得及顯示與本機產品有關的完整資訊:
Get-WmiObject ESET_Product -namespace 'root\ESET'
取得及顯示與遠端機器 (IP 10.1.118.180) 產品有關的完整資訊:
$cred = Get-Credential # promts the user for credentials and stores it in the variable
Get-WmiObject ESET_Product -namespace 'root\ESET' -computername '10.1.118.180' -cred $cred