![]() ![]() # Information: This script was adapted from the WUA_SearchDownloadInstall.vbs VBScript from Microsoft. # 17-06-2021 DT - added check for elevated privileges ![]() # Website: # Date: 19-02-2010, 07-06-2015 DT - added warnings, modified reboot logic and added email report with status code lookup # Author: Gregory Strike, Modified by Dan Tonge Note that you need to run this script with elevated privileges – start Windows PowerShell by using the Run as Administrator option if running interactively, or specify the Scheduled Task runs as the SYSTEM account and enable the ‘Run with highest privileges’ option. The two Y’s at the end of the arguments are parameters for the powershell script – the first Y is to install updates automatically, the second one is to restart automatically if needed. You can schedule this using Task Scheduler specifying these values in the Actions tab:Ĭ:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeĬ:\scripts\InstallUpdatesAndRestart.ps1 Y Y I took Gregory’s version and added some additional warnings, modified the restart logic and added an email report which includes a description of the status codes. Please note that I’m not taking credit for all of this – the original script was published by Gregory Strike back in 2011 who adapted it from a VBScript originally created by Microsoft. I’ve been using this for a few years now on Windows Server 2008 R2 and above without issues. Here’s a PowerShell script that can be used to scan for Windows updates, install them and optionally restart the system automatically. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |