Library / Windows endpoint

WIN-030 · Script

Windows Feature Upgrade with Scheduled Reboot

Moves a device to a target Windows feature release through Windows Update policy or your own setup media, and schedules the restart for a set time.

Version 1.0.0Language PowerShellUpdated November 2026

What it does

Two methods, both online and silent:

WindowsUpdate (default) Sets the Windows Update for Business policy values ProductVersion, TargetReleaseVersion and TargetReleaseVersionInfo under HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate, then asks the Windows Update client to scan. Windows Update then offers, downloads and installs that release on its own schedule. The scheduled restart only happens if Windows reports a pending restart at that time.

Setup Runs a setup program you supply (-SetupPath): setup.exe from Windows installation media you have extracted or mounted, or the Windows 11 Installation Assistant you downloaded from Microsoft. It runs silently with no restart, then the restart is scheduled.

The restart is a one-time scheduled task that runs as SYSTEM at the next -RebootTime and gives signed-in users a 5 minute warning. Use -NoReboot to skip it.

Report mode (default) logs the current version, the policy values, free space and exactly what Apply would do. Nothing is changed. Apply makes the changes. Undo removes the three policy values and the restart task (it does not roll back an upgrade that already installed; use Settings > Recovery within the rollback window for that). Runs silently as SYSTEM from any RMM or Intune. No prompts, no user interaction.

Requirements

Windows 10 or 11 Pro, Education or Enterprise, Windows PowerShell 5.1, run as SYSTEM or local admin. The Setup method needs your own Windows media or Installation Assistant. Check hardware first with WIN-029.

How to run it

  • Run as: SYSTEM or a local administrator
  • Run from: any RMM or MDM, Intune, a Group Policy startup script, a scheduled task, or an elevated PowerShell window
  • Script type: PowerShell, 64-bit
  • User interaction: none; the script never prompts
  • Timeout: 10 minutes (30 for Windows Update installs)

Settings

NameWhat it doesOptionsDefault
ModeReport (default), Apply, or Undo.Report, Apply, UndoReport
MethodWindowsUpdate (default) or Setup.WindowsUpdate, SetupWindowsUpdate
ProductVersionWindows product to target. Default 'Windows 11'. Use 'Windows 10' to stay on Windows 10.Windows 11, Windows 10Windows 11
TargetReleaseVersionFeature release to target, for example 24H2 or 25H2. Needed for the WindowsUpdate method. For the Setup method it is used only to skip devices that are already on that release.
SetupPathFull path to setup.exe or the Installation Assistant for the Setup method. Example: D:\setup.exe or C:\ProgramData\Packages\Windows11InstallationAssistant.exe.
SetupArgumentsReplace the default silent switches. Defaults: setup.exe: /Auto Upgrade /Quiet /NoReboot /DynamicUpdate Enable /Compat IgnoreWarning /CopyLogs <folder> Installation Assistant: /QuietInstall /SkipEULA /Auto Upgrade /NoRestartUI /CopyLogs <folder>
RebootTimeLocal time for the restart, 24-hour HH:mm. Default 02:00. If that time already passed today, tomorrow is used.02:00
NoRebootDo not schedule a restart.False
MinFreeGBMinimum free space on the system drive, in GB. Default 20. Apply stops if there is less.20
SetupTimeoutMinutesHow long to wait for the setup program, in minutes. Default 240.240

Exit codes

  • 0 = Already on the target release, or Apply / Undo done
  • 1 = Upgrade needed (Report), low disk space, or setup reported a problem
  • 2 = Script error or bad parameters

Testing steps

  1. Run it first with the mode set to Report on one test device. Nothing is changed in that mode.
  2. Read the log and confirm the planned changes are what you expect.
  3. Run your chosen settings on the same test target and confirm the result.
  4. Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
  5. Roll out to a small group next, then everyone.

Rollback steps

Run the script with -Mode Undo to remove the TargetReleaseVersion, ProductVersion and TargetReleaseVersionInfo policy values and the 'Runbookia Feature Upgrade Restart' scheduled task. An upgrade that already installed can be rolled back from Settings > System > Recovery within the Windows rollback window (10 days by default).

Version and change log

VersionDateChanges
1.0.0November 2026First release.