Skip to main content

Disable Windows Optional/Automatic Updates

Summary​

This task will disable the Windows optional automatic updates.

Sample Run​

Sample Run 1
Sample Run 2

Dependencies​

Windows Optional Update Disabled

Implementation​

Create Task​

To implement this script, please create a new "PowerShell" style script in the system.
Create Task

Name: Disable Windows Optional/Automatic Updates
Description: This task will disable the Windows optional automatic updates.
Category: Patching
Task Details

Script​

Start by making three separate rows. You can do this by clicking the "Add Row" button at the bottom of the script page.
Add Row

Row 1: Function: Script Log​

Script Log

In the script log message, type Running the PowerShell to set NoAutoUpdates and Hide Automatic Updates Options. so that the script will send the results of the PowerShell script above to the output on the Automation tab for the target device.
Log Message

Row 2: Function: PowerShell Script​

PowerShell Script
PowerShell Script 2

Paste in the following PowerShell script and set the expected time of script execution to 900 seconds.

PowerShell Script

Row 3: Function: Script Log​

Output​

Output

In the script log message, type %output% so that the script will send the results of the PowerShell script above to the output on the Automation tab for the target device.
Output Message

Row 4: Logic: If/Then​

If/Then Logic 1
If/Then Logic 2

Row 4a: Condition: Output Contains​

In the IF part, enter Failed to set registry in the right box of the "Output Contains" part.
Output Contains

Row 4b: Condition: Script Exit​

Add a new row by clicking on the Add row button.
Add Row Exit

In the script exit message, simply type Failed to set the registry HKLM:/SOFTWARE/Policies/Microsoft/Windows/WindowsUpdate/AU -Name NoAutoUpdate -Value 1. Exiting script with error.
Exit Message

Row 5: Function: Set Custom Field​

Select Function 'Set Custom Field'. When you select set custom field, it will open up a new window.

In this window, search for the Windows Optional Update Disabled field.

Custom Field: Windows Optional Update Disabled
Value: Disabled
Set Custom Field

Row 6: Complete​

Complete

Changelog​

2025-04-10​

  • Initial version of the document