How to install Windows updates with PowerShell on Windows Server
Windows Server installs updates from SConfig without extra software, and the third-party PSWindowsUpdate module adds Get-WindowsUpdate and Install-WindowsUpdate. Here are the exact commands, how to control the restart, and Microsoft's way to remove a cumulative update that broke something.
Key takeaways
- No module needed for the basics. Run
SConfig: on Windows Server 2022 and 2025, option 5 sets Automatic, Download only (Microsoft's default) or Manual, and option 6 searches for updates and installs all of them, one, or none. - PSWindowsUpdate is third-party, not Microsoft. Install it with
Install-Module -Name PSWindowsUpdate, list updates withGet-WindowsUpdate, then install withGet-WindowsUpdate -Install -AcceptAll -IgnoreReboot. That installs everything offered, drivers and optional updates included; add-UpdateType Softwareto leave drivers out.Install-WindowsUpdateis an alias ofGet-WindowsUpdate. - Control the restart.
-IgnoreRebootnever restarts,-AutoRebootrestarts without asking, andGet-WURebootStatus -Silenttells you whether a restart is pending. - Remove a bad cumulative update the Microsoft way: find its package name with
DISM /Online /Get-Packages, then runRemove-WindowsPackage -Online -PackageName. Where Microsoft ships the servicing stack inside the cumulative update, as on Windows Server 2022,wusa /uninstalldoes not work on it. - Patch after Patch Tuesday, not on it. Microsoft releases security updates on the second Tuesday of each month, and the September 2026 updates could make Remote Desktop unstable until a fix came out six days later.
- On a RyzenRDP server, Care installs updates in a monthly window you pick and holds back updates known to break Remote Desktop, for $29 a month on Windows.
On this page
- Short answer
- Windows Update from the command line: the commands at a glance
- Can Windows Server install updates from PowerShell without extra modules?
- How do I install the PSWindowsUpdate module?
- How do I list and install updates with Get-WindowsUpdate?
- How do I stop an unplanned reboot?
- How do I see which updates are installed?
- How do I uninstall a Windows update that broke Remote Desktop or anything else?
- When should I patch? Patch Tuesday and the September 2026 example
- Do it yourself, or have it done
- Your own Windows server
Short answer
Windows Server can install updates from the command line without extra software: run SConfig, choose option 6
(Install updates), and install all, one or none of the updates it finds. For a scriptable PowerShell command, the
usual choice, and the one most published answers lead with, is PSWindowsUpdate, a free third-party module that
Microsoft does not make: Install-Module -Name PSWindowsUpdate, then
Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot, which installs every update offered, drivers and optional
updates included (add -UpdateType Software to leave drivers out). To remove a cumulative update that broke something, Microsoft documents Remove-WindowsPackage
or DISM /Online /Remove-Package with the update's package name. Where Microsoft ships the servicing stack inside the
cumulative update, as on Windows Server 2022, wusa /uninstall does not work on it.
Windows Update from the command line: the commands at a glance
Run each command in PowerShell opened with Run as administrator.
| Task | Command | Whose tool |
|---|---|---|
| See or change the update setting, install updates | SConfig, options 5 and 6 |
Microsoft, built in |
| Ask Windows Update to scan now | UsoClient StartScan (Windows Server 2016 and later) |
Microsoft, built in |
| Install the module | Install-Module -Name PSWindowsUpdate |
PSWindowsUpdate |
| List available updates | Get-WindowsUpdate |
PSWindowsUpdate |
| Install everything offered, drivers and optional updates included, no restart | Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot |
PSWindowsUpdate |
| Install software updates only, skipping titles with "Preview", no restart | Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot -UpdateType Software -NotTitle 'Preview' |
PSWindowsUpdate |
| Is a restart pending? | Get-WURebootStatus -Silent |
PSWindowsUpdate |
| List installed updates | Get-HotFix | Sort-Object InstalledOn |
Microsoft, built in |
| Install a downloaded .msu file | wusa.exe <file>.msu /quiet /norestart |
Microsoft, built in |
| Remove the latest cumulative update | Remove-WindowsPackage -Online -PackageName <name> |
Microsoft, built in |
Can Windows Server install updates from PowerShell without extra modules?
Yes, through SConfig, Microsoft's Server Configuration tool. On Windows Server 2022 and 2025 installed as Server
Core, it opens when you sign in. On a server with the Desktop Experience, open PowerShell as Administrator and type
SConfig. On Windows Server 2016 and 2019, start it with SConfig.cmd. SConfig works when you are signed in at the
server or connected over Remote Desktop, Microsoft notes, but not in a remote PowerShell session.
Microsoft's SConfig page describes the PowerShell-based SConfig of Windows Server 2022 and 2025. The older
SConfig.cmd on Windows Server 2016 and 2019 has its own menus, which can differ from these:
- Option 5, Update setting, decides what Windows Update does by itself:
- Automatic: checks for and installs updates every day at 3:00 AM, in the server's time zone.
- Download only: finds and downloads updates, then waits for you to install them. Microsoft names this the default.
- Manual: does not check for updates by itself.
- Option 6, Install updates, searches one of three categories: all quality updates, recommended quality updates only, or feature updates. From the list it shows, you install all of them, a single one by its number, or none. In Microsoft's terms, quality updates are the regular monthly updates, security updates included, and feature updates are what used to be called operating system upgrades, so monthly patching means all quality updates.
Option 6 installs the monthly quality updates; it does not upgrade Windows Server to a newer version. For an upgrade, see how to upgrade Windows Server 2016 to 2022 or 2025.
Our guide to upgrading Windows Server 2016 to 2025 covers that route.
To start a scan for updates from the command line on Windows Server 2016 and later, run:
UsoClient StartScan
Microsoft gives it as a scan command: what installs afterwards follows your option 5 setting, or you install from
option 6 or with PSWindowsUpdate. Microsoft's Server Core update page still lists wuauclt /detectnow, but a Microsoft
post archived on Learn notes that it does nothing on Windows Server 2016 or newer and names UsoClient.exe startscan
instead. Microsoft also warns that Windows does not tell you which updates need a restart; Get-WURebootStatus -Silent,
below, shows whether one is pending.
The older scregedit.wsf /AU command, which switches automatic updates on and off, is a VBScript script. Microsoft has
deprecated VBScript and suggests SConfig or PowerShell instead.
What Microsoft's update article does not give is a PowerShell cmdlet that searches Windows Update and installs what it finds. That gap is why most answers reach for PSWindowsUpdate.
How do I install the PSWindowsUpdate module?
PSWindowsUpdate is a third-party module by Michal Gajda, free under the MIT license. Its current version on the PowerShell Gallery, 2.2.1.5, was published on 20 July 2024 and needs PowerShell 5.1 or later. It drives the Windows Update client that Windows already has.
-
Open PowerShell with Run as administrator and check the version:
$PSVersionTable.PSVersion -
Install the module from the PowerShell Gallery:
Install-Module -Name PSWindowsUpdateDepending on your repository settings, PowerShell asks you to confirm the installation, and on a fresh server it can first offer to install the NuGet provider. Answer Y to both. If the command fails with a connection error, Microsoft's Install-Module notes say the PowerShell Gallery accepts only TLS 1.2 or newer, and give this line to run first in the same window:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -
Load the module and list its commands:
Import-Module PSWindowsUpdate Get-Command -Module PSWindowsUpdateGet-Commandshows the cmdlets and their aliases.Install-WindowsUpdateis one of the aliases: the module's source on GitHub declares it as another name forGet-WindowsUpdate. The gallery page lists cmdlets only, so it showsGet-WindowsUpdatealone.
Microsoft's advice for any module you install from a gallery is to read its code before you run it for the first time.
How do I list and install updates with Get-WindowsUpdate?
# List the updates Windows Update offers this server
Get-WindowsUpdate
# Install all of them, drivers and optional updates included, without restarting
Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot
# The same command through the Install-WindowsUpdate alias
Install-WindowsUpdate -AcceptAll -IgnoreReboot
-AcceptAll installs every update found without asking about each one. Without it, the module asks you to confirm
each update. Read the list before you install everything: the module's help says its default search "contains all
updates", drivers included, and Windows Update's default search does not leave out optional updates, so the list can
include an optional preview cumulative update. To install software updates only and skip any update with Preview in
its title:
Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot -UpdateType Software -NotTitle 'Preview'
-UpdateType Software leaves driver updates out, and -NotTitle skips every update whose title contains the text you
give. The match is case-sensitive.
To install one update, or to leave one out, name it by its KB number (replace KB1234567 with yours):
Get-WindowsUpdate -KBArticleID KB1234567 -Install -AcceptAll -IgnoreReboot
Get-WindowsUpdate -NotKBArticleID KB1234567 -Install -AcceptAll -IgnoreReboot
To stop Windows Update offering an update at all, hide it. Windows Update skips a hidden update until you unhide it:
Get-WindowsUpdate -KBArticleID KB1234567 -Hide
Some updates never reach Windows Update: Microsoft publishes noncritical out-of-band updates only in the Microsoft Update Catalog. Download the update's .msu file from the catalog, read its KB article for any installation notes, and install it with the Windows Update Standalone Installer:
wusa.exe C:\Updates\<update_file>.msu /quiet /norestart
/quiet runs it without prompts, and /norestart stops it from restarting the server.
How do I stop an unplanned reboot?
PSWindowsUpdate gives you three choices when an update needs a restart. Without any of them, the module asks you.
| Parameter | What it does |
|---|---|
-IgnoreReboot |
Does not ask for a restart and does not restart automatically |
-AutoReboot |
Does not ask, and restarts when an update needs it |
-ScheduleReboot |
Restarts at the time you give |
After installing with -IgnoreReboot, check whether Windows is waiting for a restart, and plan it:
# True when a restart is pending
Get-WURebootStatus -Silent
# If a restart is pending, schedule it for 23:00 today (choose a time that is still ahead)
Get-WURebootStatus -ScheduleReboot (Get-Date -Hour 23 -Minute 0 -Second 0)
Or restart by hand in your window with Restart-Computer.
An update restart only follows an installation. With SConfig's Automatic setting, Windows installs updates every
day at 3:00 AM; with Download only or Manual, nothing installs until you choose. Microsoft's own tools can hold
the restart too: /norestart for wusa, and -NoRestart for Remove-WindowsPackage.
Before any restart, make sure you have a way back in that does not use Remote Desktop: a console that shows the server's screen, where your provider offers one. If Remote Desktop does not come back after the restart, that console still works.
On a RyzenRDP server, the RyzenRDP console is your account: servers, invoices and tickets. It does not show the server's screen, but it keeps working while Remote Desktop is down, so open a ticket of the type "Technical support" there with the error message and when it started. We tell you on the ticket whether the fix is free or $39 and ask for your OK. Once you agree, we can reach the server's screen without Remote Desktop.
How do I see which updates are installed?
Microsoft's Server Core article lists these commands:
Get-HotFix | Sort-Object InstalledOn
Get-ComputerInfo -Property OsHotFixes
To check for one update, use Get-HotFix -Id KB1234567. If it returns nothing, the update may still be there:
Get-HotFix reads the Win32_QuickFixEngineering class, and Microsoft notes that this class returns only updates
installed by Component Based Servicing, not updates supplied by Windows Installer (MSI) or the Windows Update site.
PSWindowsUpdate reads the Windows Update history instead:
# The Windows Update history
Get-WUHistory
# The last 24 hours
Get-WUHistory -MaxDate (Get-Date).AddDays(-1)
How do I uninstall a Windows update that broke Remote Desktop or anything else?
First check whether Microsoft has already fixed the problem. After the September 2026 updates made Remote Desktop unstable, Microsoft said to install the out-of-band fix or a later cumulative update directly, without uninstalling the September update first. It mentioned removing the September update only as a temporary recovery step, for a server where the fix cannot be installed. Removing a security update also removes its security fixes, so put the fix on as soon as it exists.
If you do need to remove the latest cumulative update, Microsoft's method works by package name, not by KB number:
-
Get in without Remote Desktop if Remote Desktop is broken: use a console that shows the server's screen, where your provider offers one. On a RyzenRDP server, open a ticket, as described above.
-
Find the package name. Microsoft's September 2026 Remote Desktop article searches the installed packages for the update's number like this (use your number, without "KB"):
Get-WindowsPackage -Online | Where-Object PackageName -Match '1234567' | Select-Object PackageName, PackageState, ReleaseType, InstallTimeMicrosoft's Get-WindowsPackage reference says
-PackageNamedoes not take wildcards, which is why this filters the full list instead. If nothing comes back, the package name does not carry the number: list every package, as Microsoft's Server Core update page says, and find the cumulative update package's name there:DISM /Online /Get-Packages /Format:TableA servicing stack update in the same list cannot be removed. Remove the cumulative update package, not that one.
-
Remove it, without an immediate restart:
Remove-WindowsPackage -Online -PackageName "<package_name>" -NoRestartThe DISM form is
DISM /Online /Remove-Package /PackageName:<package_name>. -
Restart in your window, then check that Remote Desktop and your apps work.
-
Stop it coming back: hide the update with
Get-WindowsUpdate -KBArticleID KB1234567 -Hide, or set SConfig option 5 to Download only or Manual until Microsoft ships a fix.
Why not wusa? wusa /uninstall /kb:1234567 is Microsoft's switch for uninstalling an update by KB number. Where
Microsoft ships the servicing stack inside the cumulative update, as on Windows Server 2022 (its update pages say so,
KB5071547 for example), it will not work on that combined package, because the package contains the servicing stack
update, which cannot be removed once it is installed. Windows Server 2016 still gets its servicing stack update
separately: the September 2026 update for it, KB5123099, asks you to install servicing stack update KB5122874 first.
The package method above removes the cumulative update by its package name on any of these versions. And
Microsoft's DISM reference warns that after DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase, installed
updates can no longer be uninstalled at all.
PSWindowsUpdate also has Remove-WindowsUpdate -KBArticleID, but for the monthly cumulative update, Microsoft documents
the package method above.
When should I patch? Patch Tuesday and the September 2026 example
Microsoft releases the monthly security update on the second Tuesday of each month, typically at 10:00 AM Pacific Time: Patch Tuesday, or Update Tuesday. Microsoft's release-cycle page, written for Windows clients, adds an optional preview update in the fourth week for the most recent supported versions, and out-of-band updates whenever Microsoft has to fix something urgent. The November 2026 security update came out on Tuesday 10 November 2026, so the next two fall on 8 December 2026 and 12 January 2027.
For Windows Server 2016, Microsoft lists the end of extended support as 12 January 2027. Our page on Windows Server 2016 end of support explains the options.
The September 2026 updates show why waiting a few days pays off. After the security updates of 8 September 2026, Microsoft confirmed that Remote Desktop Services might become unstable on Windows Server 2016, 2019, 2022 and 2025, and shipped out-of-band fixes on 14 September 2026. On Windows Server 2022, for example, the affected update was KB5122882 and the fix KB5129237. An affected server that installed the update on the day could be without working Remote Desktop until the fix was out, unless someone reached it another way. Our guide to "Remote Desktop Services is currently busy" lists the affected update and its fix for each Windows Server version and covers the symptoms and the fix in full.
A short routine for one server:
- Wait a few days after Patch Tuesday and read Microsoft's Windows release health pages and message center for known issues with your version.
- Pick a window when nobody needs the server, because many updates need a restart.
- Check your way in without Remote Desktop before you start: a console that shows the server's screen, where your provider offers one. On a RyzenRDP server, that route is a ticket from your RyzenRDP console, as described above.
- Keep copies of your important data elsewhere. Uninstalling an update does not bring back lost data.
- After the restart, sign in over Remote Desktop and check your apps. Keeping Windows updated is also one step of our RDP hardening checklist.
Do it yourself, or have it done
Everything above is free to do yourself with an Administrator account and PowerShell, and the Microsoft pages in the sources below cover every step.
If your server is with RyzenRDP and you would rather hand the job over:
- Care for Windows, $29 a month, installs Windows updates in a monthly window you pick and holds back updates known to break Remote Desktop. We install each month's updates on staff servers first. After the reboot, Care checks that Remote Desktop is running and open in the Windows firewall, restarts one service you name if it has not started, and sends you a monthly report. Each month includes 30 minutes of admin time. If the server does not come back after a window, we uninstall the update that caused it and hold it back. Care for Linux is $19 a month.
- What Care is not: it includes no backups or snapshots and no support for your own apps, and it covers RyzenRDP servers only. Care sets the server's automatic updates to wait for your window and puts them back when Care ends. You can cancel it at any time with a ticket of the type "Billing and accounts".
- A server stuck on an update screen or restarting in a loop is the "Stuck Windows Update" fix of RDP Rescue: we finish the update or roll it back, working on the server's screen without Remote Desktop. One fix costs $39, invoiced only once you can sign in again. A fault on our side is fixed free. RDP Rescue covers RyzenRDP servers only.
Your own Windows server
A RyzenRDP Windows VPS is your own Windows Server with full Administrator access, so you can run every command in this guide on it. Windows Server is installed for you but not activated: the Windows Server license is not included in the plan price, and you license and activate it yourself, as the licensing answer in our FAQ explains.
FAQ
Is PSWindowsUpdate made by Microsoft?
No. PSWindowsUpdate is a free third-party PowerShell module by Michal Gajda, published on the PowerShell Gallery under the MIT license. Version 2.2.1.5, published on 20 July 2024, needs PowerShell 5.1 or later. It drives the Windows Update client that Windows already has, and Microsoft's advice for any gallery module is to read its code before you run it the first time.
Does Windows Server install updates automatically?
Not by default. Microsoft's SConfig documentation names Download only as the default setting: Windows finds and downloads updates, then waits for you to install them. With Automatic, the server checks for and installs updates every day at 3:00 AM in its own time zone. Your provider's image or a Group Policy can set it differently, so check the current setting on SConfig's main screen.
How do I install one specific KB from PowerShell?
With the PSWindowsUpdate module, run Get-WindowsUpdate -KBArticleID KB1234567 -Install -AcceptAll -IgnoreReboot, using your KB number. That works when Windows Update offers the update to the server. If it does not, download the .msu file from the Microsoft Update Catalog and install it with wusa.exe and the file name, adding /quiet /norestart to run it without prompts or a restart.
How do I stop the server restarting after updates?
Add -IgnoreReboot when you install with PSWindowsUpdate: the module then neither asks nor restarts. Run Get-WURebootStatus -Silent to see whether a restart is pending, and restart in your own maintenance window. If you want Windows itself never to install updates unasked, set SConfig option 5 to Download only or Manual.
How do I uninstall a cumulative update on Windows Server?
Find the update's package name with DISM /Online /Get-Packages, then run Remove-WindowsPackage -Online -PackageName followed by that name, or DISM /Online /Remove-Package /PackageName: with it, and restart. Where Microsoft ships the servicing stack inside the cumulative update, as on Windows Server 2022, its update pages say wusa /uninstall does not work on that combined package, because the servicing stack part cannot be removed. Before you uninstall, check whether Microsoft has already released a fix you can install instead.
When does Microsoft release Windows updates?
Monthly security updates come out on the second Tuesday of each month, typically at 10:00 AM Pacific Time, which is known as Patch Tuesday or Update Tuesday. Microsoft's release-cycle page, written for Windows clients, adds an optional preview update in the fourth week for the most recent supported versions, and out-of-band updates whenever Microsoft has to fix an urgent problem. The November 2026 security update came out on 10 November 2026, so the next ones fall on 8 December 2026 and 12 January 2027.
Can someone patch my Windows VPS for me?
On a RyzenRDP server, yes. Care costs $29 a month on Windows and $19 a month on Linux. We install updates in a monthly window you pick, hold back updates known to break Remote Desktop, check after the reboot that Remote Desktop is running and open in the Windows firewall, restart one service you name if it has not started, and send a monthly report. Care for Windows includes 30 minutes of admin time each month. It includes no backups or snapshots, covers RyzenRDP servers only, and you can cancel it at any time with a ticket.
Sources
- Microsoft Learn: Configure Windows Server Core Windows Update (SConfig options, wuauclt, installed updates, removing the latest cumulative update; updated 10 March 2025)
- Microsoft Learn: Configure a Server Core installation of Windows Server with SConfig (update settings, the default, installing updates, where SConfig runs, SConfig.cmd on earlier versions, feature updates and installation media)
- Microsoft Learn: Update release cycle for Windows clients (the second Tuesday, preview and out-of-band updates; written for Windows clients; updated 29 September 2026) and the Windows message center
- Microsoft Learn: Troubleshoot Remote Desktop Services instability after September 2026 Windows security updates (the affected and out-of-band updates, the Get-WindowsPackage listing, UsoClient StartScan; updated 28 September 2026)
- Microsoft Support: KB5071547, December 9, 2025 update for Windows Server 2022 (why wusa /uninstall does not work on the combined package), KB5123099, September 8, 2026 update for Windows Server 2016 (servicing stack update KB5122874 installed first) and Description of the Windows Update Standalone Installer
- Microsoft Learn: DISM operating system package servicing options, Get-WindowsPackage (-PackageName does not take wildcards), Remove-WindowsPackage, Get-HotFix, Install-Module and IUpdateSearcher::Search (Windows Update's default search)
- PSWindowsUpdate: the project on GitHub (README, module source and help file, MIT license) and its PowerShell Gallery page (version 2.2.1.5, 20 July 2024)
- saotn.org: "Install Windows updates using PowerShell" (the NuGet provider step and a scheduled run with -IgnoreReboot)
- Microsoft Learn archive: wuauclt /detectnow in Windows 10 and Windows Server 2016 (wuauclt /detectnow does nothing there; UsoClient startscan instead; 9 November 2017)
- Microsoft Learn: Windows Server 2016 lifecycle (end of extended support 12 January 2027)