【问题标题】:How to check if computers on a network are running updated windows [closed]如何检查网络上的计算机是否正在运行更新的 Windows [关闭]
【发布时间】:2016-07-13 16:22:55
【问题描述】:

对不起,如果问题的表述方式令人困惑,但基本上我需要一种方法来检查网络上的所有计算机是否都已更新,因为我最近在员工的计算机上进行了服务呼叫,并注意到它尚未更新一年。有没有办法可以检查网络上的每台计算机是否已更新?我的雇主为所有员工工作站专门使用 Windows 7 pro。有没有办法可以使用 powershell 来自动执行此任务?

【问题讨论】:

  • 您好,欢迎您, 1. 您尝试过什么? 2. 用您的话来说,计算机“更新”是什么意思?您是否正在寻找已安装的特定 KB?请使用编辑按钮将详细信息和代码添加到您的问题中。

标签: windows powershell networking


【解决方案1】:

您可以执行以下操作:

# Import CSV with Workstation HostNames
$RemoteComputers = Import-Csv -Path C:\SomePath\CSVwithHostNames.csv

# Get Last Windows Update Install Date from Remote Computers
# If you don't want to use CSV you can specify like -Computername PC1, PC2, PC3
# You could also pull hostnames from Active Directory and store as variable

#PowerShell 2 or Below
Get-WmiObject -ComputerName $RemoteComputers -Class Win32_QuickFixEngineering -Property InstalledOn | Sort InstalledOn -Descending | Select InstalledOn, PSComputerName -First 1

#PowerShell 3 or Higher
Get-CimInstance -ComputerName $RemoteComputers -ClassName Win32_QuickFixEngineering -Property InstalledOn | Sort InstalledOn -Descending | Select InstalledOn, PSComputerName -First 1

输出如下:

InstalledOn           PSComputerName RunspaceId                          
-----------           -------------- ----------                          
7/13/2016 12:00:00 AM SomePCNameHere 691237f3-6ac3-4c7d-a530-5d1717309cfb

如果使用 WSUS 进行更新,那么只运行报告以查看哪些工作站缺少更新会更好/更容易。

希望这会有所帮助!以供将来参考,这不是代码编写服务,在提问时请附上您已经尝试过的代码,然后说明您在使用该代码时遇到的问题,因为您更有可能从社区收到答案。

【讨论】:

  • 我猜这需要在目标上启用 PowerShell 远程处理?
  • 是的,这是正确的,这需要启用 PowerShell 远程处理。我将在上面编辑我的答案,以消除在主机上启用 PowerShell 远程处理的需要。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-11
  • 1970-01-01
相关资源
最近更新 更多