Powershell 如何从特定PC的注册表中查找Trend的版本?

Powershell 如何从特定PC的注册表中查找Trend的版本?,powershell,registry,Powershell,Registry,我想知道是否有办法找到特定计算机的注册表值。我能找到的唯一方法是进入一个pssession然后退出 $Computer = Read-Host "Enter the PC Name: " $connection=test-connection -ComputerName $Computer -Quiet if($connection -eq $True) { Enter-PSSession $Computer $TrendServer= Get-ItemProperty -Pa

我想知道是否有办法找到特定计算机的注册表值。我能找到的唯一方法是进入一个pssession然后退出

$Computer = Read-Host "Enter the PC Name: "


$connection=test-connection -ComputerName  $Computer -Quiet
if($connection -eq $True) {




Enter-PSSession $Computer


$TrendServer= Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TrendMicro\PC-cillinNTCorp \CurrentVersion | Select Server
write-output $TrendServer



if($TrendServer -ne $null){
Exit-PSSession
 }
 } else{Write-Output "Computer is not available. Please check Lan Sweeper "}

如果它是使用Windows Installer安装的,则可以使用WMI,尽管已知此类速度非常慢:

Get-CimInstance -Query "SELECT * FROM Win32_Product WHERE Name = 'TrendMicro'" `
                -ComputerName $computer
将名称从“TrendMicro”更改为我没有安装要检查的名称,对于较旧版本的PowerShell,请使用Get-WmiObject而不是Get-CimInstance


在此处获取更多信息:

可能未使用WI。如果您只使用:Get CimInstance-Query SELECT*FROM Win32_Product,是否列出了它?啊,它是作为Trend Micro OfficeScan代理的名称。这就是我需要在您的代码中替换的内容吗?是的,将查询更改为从Win32_产品中选择*,其中名称='Trend Micro OfficeScan Agent',它确实提取了一些信息,但它没有提供我需要的数据。它显示名称、标题、供应商、版本、标识编号和计算机名。在我的代码中,它提取与给定PC使用的趋势服务器相关的服务器名称。我尝试在上面代码的末尾添加| Select Server,但没有luckYeah,这只获取一般安装详细信息。听起来您想要的东西是特定于趋势的,所以除非趋势有任何可以使用的cmdline工具或cmdlet,否则您当前使用直接注册表访问的方法看起来是唯一的方法。如果远程注册表服务正在运行,则可以使用访问它,而无需通过PowerShell远程处理。