使用PsExec远程安装Windows更新

我正在处理的问题:我现在负责公司的所有 Windows机器.所有工作站都运行Windows 7,我没有域,并且网络上没有运行Windows Server.为了管理它们,我使用PsExec在每个工作站上远程执行命令,如下所示:
FOR /F "tokens=*" %%a IN (E:\list-of-workstations.txt) DO CALL :theCommand %%a
PAUSE

:theCommand
FOR /F "tokens=1,2,3,4" %%a IN ("%*") DO (
        psexec \\%%a -s -u %%b -p %%c -c E:\script-to-execute-remotely.bat
)
GOTO:EOF

我现在想要在每个工作站上触发Windows更新.

我做过的研究:
Apparently,没有设置命令可以发送到Windows设备,专门指示他们开始安装挂起的更新.

许多服务器故障和博客主题建议使用第三方解决方案按需安装Windows更新,但所有这些推荐的第三方解决方案只有在您购买时才能使用,我不想这样做.

到目前为止为解决问题所采取的步骤:
所以,就我而言,我似乎陷入困境:没有Windows服务器,没有专门要求工作站安装更新的本机方式,我听说的所有第三方解决方案都不是免费的.

我对吗 ?你知道如何解决我面临的问题吗?

除了Michael Bailey的VBS方法之外,我修改一个我在网上找到的powershell脚本(来自technet的某个地方,但是我无法找到确切的链接):
#Define update criteria.
$Criteria = "IsInstalled=0 and Type='Software'"

#Search for relevant updates.
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
$SearchResult = $Searcher.Search($Criteria).Updates

If($SearchResult.Count -eq 0){
Write-Host "No Updates Available"
Exit
}

Write-Host "Updates Found: $($SearchResult.Count)`r`n"
$SearchResult | ForEach-Object{Write-Host "$($_.Title) `r`n"}

#Download updates.
$Session = New-Object -ComObject Microsoft.Update.Session
$Downloader = $Session.CreateUpdateDownloader()
$Downloader.Updates = $SearchResult
Write-Host "Download Results:"
$Downloader.Download()

#Install updates.
$Installer = New-Object -ComObject Microsoft.Update.Installer
$Installer.Updates = $SearchResult
$Result = $Installer.Install()
Write-Host "Install Result: $($Result.HResult) `r`n"
Write-Host "Reboot required: $($Result.Rebootrequired) `r`n"

#Reboot if required by updates.
#If ($Result.rebootrequired) { shutdown.exe /t 0 /r }

我使用PDQ运行它,但也将它与PSExec一起使用.如果您只想将每台计算机的更新列为审核,则可以在搜索部分之后删除所有内容.

当我在寻找更新问题的答案时,我也对此进行了长时间的研究:
http://blogs.technet.com/b/heyscriptingguy/archive/2011/08/13/use-powershell-to-audit-and-install-windows-patches.aspx

它看起来像一个可能适合您的组织的工具.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...