This article will show you how I patch my Windows Nano Server 2016 Server using 3 easy scripts.
I used those scripts recently for a client update job and the result was amazing.
The process Is built from 3 scripts:
- SCAN_UPDATES.PS1 – Check for updates
- INSTALL_UPDATES.PS1 – Install available updates
- CHECK_INSTALLED_UPDATES.PS1 – Check Installed updates
To start, First connect to your Nano Server using:
- Connect To A Nano Server Using PowerShell Direct
- How To Connect To A Windows Nano Server Using PowerShell.
Next copy the scripts to your Nano Server or use PSedit to create and copy:
- Copy Files To A Nano Server Using Remote PowerShell 5
- Edit Remote PowerShell Scripts Using PSEdit And ISE
Once connected check for updates using script 1:
If updates available run script #2 to Install them:
#INSTALL UPDATES
$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates Restart-Computer; exit
Once done, I run script number #3 to check for Installed updates
Download Scripts (change .TXT to .PS1: