在 CMD 中检查域中其他 PC 的 CPU 规格

在 CMD 中检查域中其他 PC 的 CPU 规格
systeminfo /s srvmain

因此,我在 CMD 中使用上述命令创建了域中每台 PC 规格的电子表格。但是,它没有提供准确的 CPU 信息。有没有办法远程找出我们域中 PC 的 CPU?有些 PC 通过 VPN 位于异地,因此无法走过去检查。

提前致谢。

答案1

您可以使用Win32_ProcessorWMI 类并通过 PowerShell 读取它

# Get Credentials of a Domain Account that has Admin Permission on RemoteComputers
$AdminCredentials = Get-Credential

# Declare list of Computers
$Computers = "Computer1", "Computer2", "Computer3"
# You could also read the Computers from a DC, play around with the -Filter
# $Computers = Invoke-Command -ComputerName DCServer { Get-ADComputer -Filter * } | Select-Object -ExpandProperty Name

# Declare Properties you want to get (run Get-CimInstance Win32_Processor | fl * to see all properties)
$Properties = "PSComputerName", "Name", "NumberOfCores"

# Create CIM Sessions
$CIM = New-CimSession -ComputerName $Computers -Credential $AdminCredentials

# Run the command
$Result = Get-CimInstance -ClassName Win32_Processor -CimSession $CIM | Select-Object $Properties

答案2

我相信你需要使用WMIC 工具

要获取有关 CPU 的所有信息,您可以调用

wmic CPU GET /format:list

要获取特定字段,例如 CPU 名称,您可以调用:

wmic CPU GET NAME /format:list

这将返回类似

Name=Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz

这足以获取所有其他信息,例如来自 Intel Ark 数据库的信息。

要使用 WMIC 查询远程计算机,我们有Serverfault 上的相关问题归结为:

wmic /NODE:"servername" /USER:"yourdomain\administrator" CPU GET NAME /format:list

相关内容