locked
Install updates on set date RRS feed

  • Question

  • Hi All,

    I am trying to get some non critical servers to automatically install windows updates from WSUS and then reboot. I know in Group Policy I can set it to install updates on a particular day of the week, but I would like to install updates and reboot on the last weekend of the month.

    I have tried creating a simple batch file with the following lines in it, attached to a scheduled task

    wuauclt.exe /updatenow

    shutdown /r /f /t 0

    This works ok when logged in as a user but will not work when not logged in. I did set option "run whether user is logged on or not" The reboot command works ok, but it would appear that wuauclt.exe /updatenow will not work on the login screen even with the task set to use the local administrator account.

    Can someone either tell me how I can set updates to install on a specific date, or tell me how to get the wuauclt.exe command to work under the login screen. This is for Windows 2008 R2 and above.

    Thanks

    Wednesday, July 2, 2014 1:31 PM

Answers

  • Hi,

    I think the bast way to go around this is to use a script that connects to the update server, gets a list of appicable updates and installs them. Something like:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa387102(v=vs.85).aspx

    by removing the prompts you can download and install any updat of your liking.

    i would even have the script check the update schedule that applies and handle the reboot.


    MCP/MCSA/MCTS/MCITP

    • Marked as answer by CenFeynman Thursday, July 3, 2014 9:57 AM
    Wednesday, July 2, 2014 2:42 PM

All replies

  • Hi,

    I think the bast way to go around this is to use a script that connects to the update server, gets a list of appicable updates and installs them. Something like:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa387102(v=vs.85).aspx

    by removing the prompts you can download and install any updat of your liking.

    i would even have the script check the update schedule that applies and handle the reboot.


    MCP/MCSA/MCTS/MCITP

    • Marked as answer by CenFeynman Thursday, July 3, 2014 9:57 AM
    Wednesday, July 2, 2014 2:42 PM
  • Can someone either tell me how I can set updates to install on a specific date

    This technique has been discussed dozens of times in the forum. With the native WSUS/WUA environment this is done by [1] scheduling a weekly update installation event on the day of your choosing, and [2] approving the updates for installation no more than =168= hours in advance of the scheduled installation time, but at least =24= hours in advance. If you want the client systems to download the updates before the actual installation event, then set approve the updates at least =48= hours in advance. I would also configure these systems with 12 hour detection frequencies.

    or tell me how to get the wuauclt.exe command to work under the login screen.

    You cannot. The Wuauclt.exe is a CLI interactive utility used to allow a logged on user to access the WUA API. In Vista and later systems it was functionally replaced by the Control Panel Windows Update applet, but retained in the WUA distribution since the WUA applies to ALL operating system versions.

    If you want to run something as a non-interactive task, you'll need to write code against the WUA API to do this. There are scripts already written that do this.


    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

    Wednesday, July 2, 2014 6:32 PM
  • Thanks SenneVL, with some modification of that script it worked perfectly.

    Thanks for the advice.

    Thursday, July 3, 2014 9:57 AM