Learn how to a build a cloud-first strategyRegister Now


WSUS - Client based script to perform updates once a month

Posted on 2012-09-19
Medium Priority
Last Modified: 2012-10-15
I am fully happy with my Group Policies for my servers to automatically download patches but wait for a manual prompt to install.

With a large scale server farm, I want to install these updates once a month only, and potentially have split schedules (i.e. One domain controller one week of the month, another a week later etc.) Of course Microsoft do not offer any facility beyond just once a week, scheduling between Monday to Sunday only.

I want to be able to script a way of getting the WSUS updates to just apply and reboot unattended if required (note the "Install Updates and Shutdown" option is useless on servers as shutting down needs to be REBOOT!)

I would then intend on scheduling via Scheduled Tasks. Has anyone done something like this before and is able to tell me what commands/scripts are required to just do the apply and reboot? Thanks
Question by:sterlingdev
LVL 65

Accepted Solution

RobSampson earned 1000 total points
ID: 38416175
Hi, this looks like it should fit the bill for you:



Assisted Solution

CitizenRon earned 1000 total points
ID: 38464003
You might simply try disabling the Windows Update service ("WUAUSERV") on all your servers except for the one day a month you want it to do its work.  Then you would set up your WSUS policy to download and install updates automatically.

Then on that one day you want it to actually work, run a script that enables WU, gets the updates from WSUS, waits a while for things to finish and then reboot.

Here's a quick and dirty batch just off that does that that you can put in the server's Task Scheduler once a month.

@Echo Off
SC config WUAUSERV start=demand
WUAUCLT /detectnow
PING -n 18000 localhost
SC config WUAUSERV start=disabled
SHUTDOWN -r -t 0

Open in new window


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question