0

We have multiple WSUS Servers, but for the example we will only be focused on one WSUS server.

Here is the situation :

  • I have multiple Windows Update patches to be downloaded and installed on almost 1000 machines.
  • On certain machines there are more than 250 Windows Update patches that haven't been downloaded or installed.

  • if we push (download and install) them in a row (on a single machines) we have some trouble sometimes and all the patches are uninstalled, so we need to redownload all the patches and reinstall these 30 patches by 30 patches to make sure that they are being installed correctly.

I wanted to create a .bat or .vbs script (I need to execute it on Windows XP machines too) to stop the installation process when the Windows Update is at 30 patches, because actually I'm doing this manually and I can't find what I was looking for.

Manually stop installation:

manually stop installation

5
  • 1
    You shouldn't recreate the wheel, WSUS Offline functions the way you describe, and already exists and has been tested by a huge community.
    – Ramhound
    Oct 4, 2019 at 14:22
  • Consider putting these computers in separate groups in WSUS and only approve a small subset of the patches for the group. As the patches get installed, approve more patches until they have been brought up to date. Oct 4, 2019 at 14:41
  • Thanks for the reply Ramhound but i'm not sure that i found what i needed in WSUS Offline, i tested it a few minutes ago and it's not solving my problem :) @TwistyImpersonator Yeah we did that during a time, but it's impacting a lot of machines, so we can't really play with the groups in WSUS. That's why i'm looking for a script that can stop the installation at 30 patches ^^
    – Justiice
    Oct 4, 2019 at 14:44
  • You can't use a script to interrupt or otherwise control Windows Update once it's been told to install patches. If you want to limit the number of patches being installed you need to do what I've suggested or use a third party patch management solution (which will still end up requiring the same approach). Oct 4, 2019 at 14:48
  • That's what i was thinking ^^ Thanks for the reply anyway, i thought maybe by adding a registry key we would stop the installation but anyway thanks a lot :)
    – Justiice
    Oct 4, 2019 at 14:53

1 Answer 1

0

I hope you've solved this problem by now, but here's an approach to take if you haven't.

There's no way to configure Automatic Updates to only install a certain number of updates in a pass.

However, Automatic Updates isn't your only solution here. You can write a script that uses the Windows Update Agent API to install downloads on your own schedule.

The script "Searching, Downloading, and Installing Updates" on the Microsoft website is a good starting point. You don't really have to understand the WUA API at all to see what it's doing:

  • It searches for all the applicable updates and lists them out.
  • It downloads all the updates it found.
  • It checks to see which updates successfully downloaded, then installs them.

It's pretty easy to modify this script to do whatever behavior you want (and the folks over at Stack Overflow can help if you run into challenges you can't solve). So, for example, if you don't want to download and install more than 30 updates at a time, you can just find the part of the script that says:

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

For I = 0 to searchResult.Updates.Count-1

And change it to:

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")
updateDownloadCount = searchResult.Updates.Count-1
If updateDownloadCount > 30 Then
    updateDownloadCount = 30
End If
For I = 0 to updateDownloadCount-1

Now the script will just download and install the first 30 updates it found in the search.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .