Skip to main content

Get Feature Update Deferral Days

Summary

Fetches the current feature update deferral setting from the local machine. The output is automatically mapped to the Feature Update Deferral Days custom field, with a value of 0 indicating the policy is inactive.

Sample Run

Image1

Dependencies

Custom Fields

NameExampleLevelTypeRequiredDescription
Feature Update Deferral Days100EndpointTextYesStores the current feature update deferral setting fetched by the script.

Task Setup Path

  • Tasks Path: AUTOMATIONTasks
  • Task Type: Script Editor

Task Creation

Description

  • Name: Get Feature Update Deferral Days
  • Description: Fetches the current feature update deferral setting from the local machine. The output is automatically mapped to the "Feature Update Deferral Days" custom field, with a value of 0 indicating the policy is inactive.
  • Category: Data Collection

Image2

Script Editor

Row 1: PowerShell script

  • Use Generative AI Assist for script creation: False
  • Expected time of script execution in seconds: 300
  • Continue on Failure: False
  • Run as: System
  • Operating System: Windows
  • PowerShell Script Editor:
<#
.SYNOPSIS
Retrieves the number of days Windows feature updates are currently deferred.

.DESCRIPTION
This script queries the local registry to determine if Windows feature updates are configured to be deferred via local policy.

It checks the 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' key. If the 'DeferFeatureUpdates' policy is active (set to 1) and the 'DeferFeatureUpdatesPeriodInDays' is 1 day or greater, the script outputs that exact number of days.

If the registry path does not exist, the policy is disabled, or the deferral period is less than 1, the script outputs '0'.

.EXAMPLE
.\Get-FeatureUpdateDeferral.ps1

# Expected Output (if updates are deferred by 30 days):
30

.EXAMPLE
.\Get-FeatureUpdateDeferral.ps1

# Expected Output (if deferral is disabled or not configured):
0

.OUTPUTS
System.String (via the Information stream)
#>

#region globals
$ProgressPreference = 'SilentlyContinue'
$WarningPreference = 'SilentlyContinue'
$ErrorActionPreference = 'SilentlyContinue'
#endregion

#region variables
$regPath = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
$deferRegName = 'DeferFeatureUpdates'
$deferDaysRegName = 'DeferFeatureUpdatesPeriodInDays'
#endregion

#region main
if (Test-Path -Path $regPath) {
if ((Get-ItemProperty -Path $regPath -Name $deferRegName).$deferRegName -eq 1) {
$deferDays = (Get-ItemProperty -Path $regPath -Name $deferDaysRegName).$deferDaysRegName
if ($deferDays -ge 1) {
Write-Output -InputObject $deferDays
return
}
}
}
#endregion

Write-Output -InputObject '0'

Image3

Row 2: Script Log

  • Script Log Message: %Output%
  • Continue on Failure: False
  • Operating System: Windows

Image4

Row 3: Set Custom Field

  • Custom Field: Feature Update Deferral Days
  • Value: %Output%
  • Continue on Failure: False
  • Operating System: Windows

Image5

Completed Script

Image6

Output

  • Script Log
  • Custom Field

Scheduled Task

Task Details

  • Name: Get Feature Update Deferral Days
  • Description: Fetches the current feature update deferral setting from the local machine. The output is automatically mapped to the "Feature Update Deferral Days" custom field, with a value of 0 indicating the policy is inactive.
  • Category: Data Collection

Image7

Schedule

  • Schedule Type: Schedule
  • Timezone: Local Machine Time
  • Start: <Current Date>
  • Trigger: Time At <Current Time>
  • Recurrence: Every day

Image8

Targeted Resource

Device Group: Windows 11 Machines

Image9

Completed Scheduled Task

Image10

Changelog

2026-03-11

  • Initial version of the document