我想保持Windows自动更新启用,但阻止一个特定的补丁被安装,这是造成我们的问题。
这个是可能的吗?有人知道怎么做吗?
发布于 2011-12-15 18:25:13
在更大的网络中,正如DanBig所指出的那样,您将希望使用WSUS。但是,如果您想阻止单个热修复,可以使用以下脚本使用热修复ID来阻止:
If Wscript.Arguments.Count = 0 Then
WScript.Echo "Syntax: HideWindowsUpdate.vbs [Hotfix Article ID]" & vbCRLF & _
"Examples:" & vbCRLF & _
" - Hide KB940157: HideWindowsUpdate.vbs 940157"
WScript.Quit 1
End If
Dim hotfixId
hotfixId = WScript.Arguments(0)
Dim updateSession, updateSearcher
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateUpdateSearcher()
Wscript.Stdout.Write "Searching for pending updates..."
Dim searchResult
Set searchResult = updateSearcher.Search("IsInstalled=0")
Dim update, kbArticleId, index, index2
WScript.Echo CStr(searchResult.Updates.Count) & " found."
For index = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(index)
For index2 = 0 To update.KBArticleIDs.Count - 1
kbArticleId = update.KBArticleIDs(index2)
If kbArticleId = hotfixId Then
WScript.Echo "Hiding update: " & update.Title
update.IsHidden = True
End If
Next
Next如果更新未链接到KB文章,则需要使用以下脚本查找更新ID:
Dim updateSession, updateSearcher
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateUpdateSearcher()
Wscript.Stdout.Write "Searching for pending updates..."
Dim searchResult
Set searchResult = updateSearcher.Search("IsInstalled=0")
Dim update, kbArticleId, index, index2
WScript.Echo CStr(searchResult.Updates.Count) & " found."
For index = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(index)
WScript.Echo update.Identity.UpdateID & ": " & update.Title
Next并使用以下脚本阻止它:
If Wscript.Arguments.Count = 0 Then
WScript.Echo "Syntax: HideWindowsUpdateById.vbs [Update ID]" & vbCRLF & _
"Examples:" & vbCRLF & _
" - Hide KB940157: HideWindowsUpdateById.vbs 2ba85467-deaf-44a1-a035-697742efab0f"
WScript.Quit 1
End If
Dim updateId
updateId = WScript.Arguments(0)
Dim updateSession, updateSearcher
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateUpdateSearcher()
Wscript.Stdout.Write "Searching for pending updates..."
Dim searchResult
Set searchResult = updateSearcher.Search("UpdateID = '" & updateId & "'")
Dim update, index
WScript.Echo CStr(searchResult.Updates.Count) & " found."
For index = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(index)
WScript.Echo "Hiding update: " & update.Title
update.IsHidden = True
Next您也可以在Windows中完成上述所有操作。我在VBScript中创建脚本最初是因为我希望在安装PoSH之前与进行交互。Windows是记录在MSDN上。
发布于 2010-05-27 13:10:34
如果使用的是WSUS,则可以拒绝更新。否则我就不知道怎么做了。
发布于 2010-05-27 15:18:52
在Windows应用程序中(在Vista和7上),右键单击要阻止的更新并选择“隐藏更新”。这将从列表中删除它,并阻止在自动安装期间安装它。你可以在将来的任何时候“恢复”隐藏的更新,这样它就会出现在列表上。
在旧样式的Windows网站(用于Windows )上有一个类似的过程,您可以在这个过程中隐藏更新。然而,这样做的选择是在不同的地方。
https://serverfault.com/questions/145843
复制相似问题