使用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更新. 我做过的研究: 许多服务器故障和博客主题建议使用第三方解决方案按需安装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一起使用.如果您只想将每台计算机的更新列为审核,则可以在搜索部分之后删除所有内容. 当我在寻找更新问题的答案时,我也对此进行了长时间的研究: 它看起来像一个可能适合您的组织的工具. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- windows-server-2008 – 如何防止子网中的另一台服务器在重
- Windows上的C Profiler
- windows – 批处理脚本:迭代驱动器号?
- 在Win7上加载rJava包时出现问题
- 在Win32中的ListView中永久保留行
- Windows:如何创建自定义appcompat填充程序(应用程序修复程
- 如何在Windows上设置Dave Raggett的HTML Tidy?
- 来自titan 1.0.0的gremlin在Windows上没有开箱即用
- windows-8 – Windows 8 WinRT KeyboardCapabilities.Keybo
- windows-server-2008-r2 – 虚拟音频电缆在Windows Server