WSUS - Client based script to perform updates once a month

Posted on 2012-09-19
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

    Hi, this looks like it should fit the bill for you:


    LVL 7

    Assisted Solution

    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
    SC start WUAUSERV
    WUAUCLT /detectnow
    PING -n 18000 localhost
    SC config WUAUSERV start=disabled
    SHUTDOWN -r -t 0

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now