← Back to articles Intune

Intune Maintenance Windows for Windows Updates That Stick

Intune Maintenance Windows for Windows Updates That Stick
🎬

Video Brief & Interactive Architecture Deck

Watch the walkthrough, explore the 16:9 interactive slide deck, or download PDF notes

▶️ Fullscreen Video ▶️ Watch on YouTube 🔔 Subscribe to MSEndpoint TV

Friday, 5:07 PM. The helpdesk ticket says “Windows ignored our patch schedule again,” somebody points at Active Hours, somebody else points at update deadlines, and the device in question decided to reboot at 10:14 AM during payroll. That’s usually the moment where you remember Active Hours is a user-experience boundary, not a hard install orchestration tool. If you actually need Windows OS and driver updates to scan, install, and restart inside a known change window, you want maintenance windows — and you want them configured with enough runway to finish the job.

This walkthrough builds a production-usable Intune policy for Windows maintenance windows using the Update CSP under ./Device/Vendor/MSFT/Policy/Config/Update/*, shows the exact portal path, and gives you a Graph-based scripted option with retries for the usual 429 throttling and 409 duplicate-name nonsense. We’ll also validate it on the endpoint, because trusting a green check in the portal without checking PolicyManager and DeviceManagement-Enterprise-Diagnostics-Provider logs is how you end up debugging patch behavior at dinner.

CLOUD POLICY FLOW MDM DELIVERY CLIENT ENFORCEMENT Intune Device Config Custom OMA-URI Profile Update CSP values and assignments Microsoft Graph deviceConfigurations Create, assign, validate Entra Group Targeting Contoso Workstations Assigned user or device groups Intune MDM Channel SyncML Delivery Policy payload to Windows device DeviceManagement-Enterprise- Diagnostics-Provider CSP processing and result codes PolicyManager Registry HKLM\...\current\device\Update Effective MaintenanceWindow* Windows Update Engine Scan, Install, Restart Allowed only inside configured window Intune Reporting Profile + Device Status Admin-side confirmation
Maintenance window policy starts in Intune or Graph, travels through the MDM SyncML channel, lands in PolicyManager on the device, and only then affects Windows Update behavior. If the registry and DM-EDP events don’t agree with the portal, the device wins the argument.

What We’re Building & Prerequisites

We’re building an Intune-delivered Windows Update maintenance window that constrains OS and driver update actions to a repeatable schedule, with enough duration for the full lifecycle: policy receipt, scan, download, install, pending reboot, and restart. The cleanest deployment path in enterprise tenants is a Windows custom device configuration profile using the Update CSP OMA-URI settings, because those values map directly to the Windows MDM layer and are easy to validate on-box.

Requirement Recommended Value Why it matters
Licensing Microsoft Intune Plan 1 or suite including Intune Needed to deploy device configuration profiles
Entra ID role Intune Administrator or equivalent scoped role Create, assign, and review configuration profiles
Graph permissions DeviceManagementConfiguration.ReadWrite.All Needed for scripted profile creation and assignment
Target OS Windows 10/11 MDM-managed devices; test first on current Windows 11 builds Maintenance window support can vary by build and UI exposure
Device state Intune enrolled, MDM authority active, healthy sync If the device isn’t checking in, none of this becomes real
Recommended grouping Dedicated device group for patch window targeting Avoid overlap with pilot rings, kiosk profiles, or special-purpose devices

Build awareness matters. Microsoft’s Update CSP reference includes settings that are preview-only or build-gated. Don’t assume every maintenance window key is honored on every Windows build in your estate. Mixed 22H2/23H2/24H2 fleets are where “configured” and “effective” stop meaning the same thing.

Step-by-Step Implementation

  1. Decide the real maintenance window, not the imaginary one

    Before touching Intune, work backward from reboot reality. A one-hour window sounds neat in a CAB meeting and fails miserably on a laptop that hasn’t scanned in six days, needs a Servicing Stack update, and is sitting on hotel Wi-Fi. For most enterprise workstations, start with a 4-hour weekly window. If driver updates are included, or devices are often asleep, consider 6 hours.

    Scenario Cadence Duration Comment
    Office desktops Weekly 4 hours Usually enough for quality update install + restart
    Hybrid laptops Weekly 6 hours More tolerance for sleep, VPN, slow content retrieval
    Driver-heavy engineering devices Weekly 6 hours Firmware and driver actions are rarely polite
    Kiosk / shared devices Daily or weekly Depends on service window Coordinate with app owners and reboot tolerance
  2. Create the custom Windows profile in Intune

    Go to Intune admin center > Devices > Configuration > Create > New policy.

    Choose:

    • Platform: Windows 10 and later
    • Profile type: Templates > Custom

    Name it something boring and obvious, for example: WU - Maintenance Window - Weekly Sat 01:00-05:00. Boring names are good names when you’re filtering logs at 2 AM.

  3. Add the core OMA-URI settings

    Under Configuration settings, add OMA-URI entries for the Update CSP. Use device scope and integer or string values exactly as required by the CSP. The anchor pattern below is a practical weekly schedule that starts at 01:00 on Saturday and lasts 4 hours.

    Setting OMA-URI Data type Recommended value Why
    Enable maintenance windows ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowEnabled Integer 1 Turns the feature on
    Duration ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowDurationHours Integer 4 Enough time for install and restart in most estates
    Start date ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartDate String 2026-11-28 Anchor date for the first window; use your next intended cycle
    Start time ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartTime String 01:00 Off-hours local device time anchor
    Repeat option ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowRepeatScheduleOption Integer Weekly value per build support Controls recurrence type; verify supported enum in your build testing
    Weekly Saturday ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklySaturday Integer 1 Run the window on Saturday
    Weekly interval ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklyInterval Integer 1 Every week
    Update actions ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowUpdateActions Integer Use the action value validated in your tenant/build Determines which update actions are allowed in-window

    Two settings need build-aware validation: MaintenanceWindowRepeatScheduleOption and MaintenanceWindowUpdateActions. Microsoft’s CSP reference identifies the nodes, but enum exposure and behavior can vary. Test those values on a pilot device and confirm the corresponding MaintenanceWindow* entries appear under HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Update.

  4. Assign it to a clean device group

    Under Assignments, target a dedicated device group such as Contoso-Windows-Workstations-Prod-MW-Sat0100. Avoid stacking this profile on the same devices as experimental patch controls unless you enjoy conflict hunting in three portals and a registry hive.

    If you run phased deployment, do this in order:

    • Pilot devices
    • IT-managed early adopters
    • Broader production groups
  5. Keep update rings and deadlines compatible with the window

    Maintenance windows don’t live in a vacuum. Check existing update rings under Intune admin center > Devices > Windows updates > Update rings for Windows 10 and later. If you’ve configured aggressive deadlines or restart behavior that effectively pressures the device outside your intended schedule, users will still feel the pain.

    Recommended pattern:

    • Use maintenance windows for execution timing
    • Use update rings for offer/deferral/restart UX posture
    • Don’t assume Active Hours will pin actual install timing
  6. Force a sync on a test device and wait like a professional

    On the device, go to Settings > Accounts > Access work or school > Connected tenant > Info > Sync or use Company Portal. Then wait a bit. Sometimes a little. Sometimes just enough to make you wonder why you didn’t become a network engineer instead.

Automated / Scripted Alternative (Graph API / PowerShell)

If you’d rather stamp this out through code, create a Windows custom configuration profile through Microsoft Graph and then assign it to a group. The sample below uses Microsoft Graph PowerShell v2 and handles duplicate names, 429 throttling, and basic request retries. You still need to supply the enum values you’ve validated in your own Windows build testing for repeat schedule and update actions.

🔐 Cloud Authentication Tip: Use Connect-MgGraph -UseDeviceAuthentication for reliable MFA prompt support across Cloud Shell and headless administration servers.
# Required Scopes: DeviceManagementConfiguration.ReadWrite.All, Group.Read.All
# Tested with Microsoft.Graph v2 in production-style tenants

Param (
    [Parameter(Mandatory,
    [Parameter(Mandatory
)]
    [string]$TenantGroupId,

    [string]$ProfileName = "WU - Maintenance Window - Weekly Sat 01:00-05:00",

    [string]$StartDate = "2026-11-28",

    [string]$StartTime = "01:00",

    [int]$DurationHours = 4,

    # Validate these values against your target Windows build
    [int]$RepeatScheduleOption = 2,
    [int]$UpdateActions = 1,

    [switch]$WhatIf
)

function Invoke-GraphWithRetry {
    ]
        [scriptblock]$ScriptBlock,
        [int]$MaxRetries = 5
    )

    $attempt = 0
    do {
        try {
            $attempt++
            return & $ScriptBlock
        }
        catch {
            $message = $_.Exception.Message
            if ($message -match "429" -or $message -match "Too Many Requests") {
                $sleep = [Math]::Min(60, 5 * $attempt)
                Write-Warning "Graph throttled (429). Retrying in $sleep seconds..."
                Start-Sleep -Seconds $sleep
                continue
            }
            elseif ($message -match "409" -or $message -match "Conflict") {
                throw "Graph conflict (409). A profile with the same name may already exist. ProfileName='$ProfileName'"
            }
            else {
                throw
            }
        }
    } while ($attempt -lt $MaxRetries)

    throw "Graph request failed after $MaxRetries attempts."
}

try {
    Connect-MgGraph -Scopes "DeviceManagementConfiguration.ReadWrite.All","Group.Read.All" -NoWelcome | Out-Null
    $ctx = Get-MgContext
    if (-not $ctx) {
        throw "Graph connection context was not established."
    }

    $existing = Invoke-GraphWithRetry -ScriptBlock {
        Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations?`$filter=displayName eq '$($ProfileName.Replace("'","''"))'"
    }

    if ($existing.value.Count -gt 0) {
        throw "A device configuration named '$ProfileName' already exists. Use a unique name or switch to PATCH logic."
    }

    $omaSettings = @(
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowEnabled"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowEnabled"
            value         = 1
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowDurationHours"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowDurationHours"
            value         = $DurationHours
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingString"
            displayName   = "MaintenanceWindowStartDate"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartDate"
            value         = $StartDate
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingString"
            displayName   = "MaintenanceWindowStartTime"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartTime"
            value         = $StartTime
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowRepeatScheduleOption"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowRepeatScheduleOption"
            value         = $RepeatScheduleOption
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowWeeklySaturday"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklySaturday"
            value         = 1
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowWeeklyInterval"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklyInterval"
            value         = 1
        },
        @{
            "@odata.type" = "#microsoft.graph.omaSettingInteger"
            displayName   = "MaintenanceWindowUpdateActions"
            omaUri        = "./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowUpdateActions"
            value         = $UpdateActions
        }
    )

    $body = @{
        "@odata.type" = "#microsoft.graph.windows10CustomConfiguration"
        displayName   = $ProfileName
        description   = "Constrains Windows update actions to a weekly Saturday maintenance window."
        omaSettings   = $omaSettings
    } | ConvertTo-Json -Depth 10

    if ($WhatIf) {
        Write-Host "WhatIf: would create device configuration profile:"
        $body
        exit 0
    }

    $created = Invoke-GraphWithRetry -ScriptBlock {
        Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations" -Body $body -ContentType "application/json"
    }

    if (-not $created.id) {
        throw "Profile creation returned no ID."
    }

    $assignBody = @{
        assignments = @(
            @{
                target = @{
                    "@odata.type" = "#microsoft.graph.groupAssignmentTarget"
                    groupId = $TenantGroupId
                }
            }
        )
    } | ConvertTo-Json -Depth 6

    Invoke-GraphWithRetry -ScriptBlock {
        Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/$($created.id)/assign" -Body $assignBody -ContentType "application/json"
    } | Out-Null

    Write-Host "Created and assigned profile: $ProfileName"
    Write-Host "Profile ID: $($created.id)"
    exit 0
}
catch {
    Write-Error $_
    exit 1
}

Good production habit: store the validated enum mappings for MaintenanceWindowRepeatScheduleOption and MaintenanceWindowUpdateActions in source control with your tenant automation. Future you will not remember why “2” was safe on that pilot wave six months from now.

Validation & Fleet Verification

First validate in Intune, then validate on a device, then believe it. In the admin center, open the profile and check Device status and Per-setting status for failures. If devices show Succeeded, move to endpoint proof.

On a managed Windows device, run:

🔍 Read-Only Audit Script: This script queries your tenant without altering any settings or device configurations. Safe to execute in production.
# Effective maintenance window values from PolicyManager
# Run in elevated PowerShell
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Update' |
    Select-Object MaintenanceWindow*

# Optional: inspect enrollment and MDM state
dsregcmd /status

You should see effective values such as MaintenanceWindowEnabled, MaintenanceWindowDurationHours, MaintenanceWindowStartDate, and other recurrence members if the device accepted the payload.

Then open Event Viewer > Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostics-Provider > Admin. Filter around the time of sync and look for CSP processing entries referencing the Update area. This is where you’ll catch malformed values, unsupported settings, or rejected payloads before users catch them for you.

Useful forensic split: if Intune says Pending, think sync/targeting. If Intune says Succeeded but the registry is missing values, think local processing delay or stale reporting. If DM-EDP shows failures, trust the event log over the dashboard.

Gotchas & Edge Cases

Trap What actually happens What to do
Window too short Scan/download/install starts but reboot or completion spills to the next cycle Increase duration to 4-6 hours, especially for laptops and driver-inclusive schedules
Conflicting update controls Active Hours, deadlines, update rings, and GPO-backed Windows Update settings muddy behavior Review all Windows Update policies; on newer supported builds consider IgnoreWindowsUpdateGroupPolicies only after confirming equivalent MDM settings exist
Mixed build behavior Some MaintenanceWindow nodes may be present in CSP docs but not honored equally across builds Pilot by build family and verify registry + DM-EDP events on each
Portal success, endpoint not ready Intune profile reports green before the device has completed a useful update cycle Validate at next scheduled window and correlate with Windows Update client behavior
Duplicate custom profile names Automation hits Graph 409 conflict and your pipeline faceplants Use deterministic naming or implement GET-then-PATCH logic

Big one: maintenance windows don’t magically wake every device, keep VPN alive, and solve every reboot prompt. If machines are asleep, off network, or blocked by conflicting policy, the schedule can still miss. If you need stronger overnight success rates, pair this with sane power policy, update ring review, and realistic maintenance duration instead of a tiny “nobody will notice” window.

That’s the pattern that tends to stick in production: custom Update CSP profile, clear recurrence, enough hours to finish, isolated assignments, and endpoint validation through PolicyManager plus DM-EDP logs. The maintenance window is the scheduling primitive; the rest of your Windows Update stack has to stop fighting it. Once you get that alignment right, patch nights get a lot quieter — or at least quiet enough that the next problem can wait until Monday.

Was this article helpful?

🎯
MSEndpoint Academy · MD-102

Assess Your Microsoft 365 & Intune Skills (MD-102)

100% Free • 10 Real Questions

Applying this guide in production? Test your technical readiness against real exam scenarios from Microsoft 365 Certified: Endpoint Administrator (MD-102).

💡 MD-102 Express Knowledge Check Question 1 of 10

Which official utility is required to convert a Win32 application installer (.exe) into the package format (.intunewin) for deployment via Microsoft Intune?

🔒 100% Free • 📊 Instant Explanations • 🖥️ Pearson VUE Mode
Take Free 10-Question MD-102 Diagnostic → MD-102 2026 Exam Guide & Sample Q&A Launch Pearson VUE Simulator
🎁 Free Community Automation Hub

Functional Automation & Blueprints

Production-ready scripts, GitHub repositories, and architectural blueprints created for this technical guide.

PowerShell, Microsoft Graph, Intune
AUTOMATION TOOLKIT

Intune Maintenance Windows for Windows Updates That Stick (M365 SaaS Engine Ready)

Creates and assigns an Intune Windows custom configuration profile using Windows Update CSP maintenance window OMA-URI settings via Microsoft Graph, with retries for 429/409 and on-endpoint validation guidance.

Star on GitHub Download .ps1
💡 Enterprise Blueprint
HIGH IMPACT

Intune Patch Window Doctor

Detect and fix “patch schedule didn’t stick” issues by validating Maintenance Window policies end-to-end (Intune → MDM → endpoint) and retrying Graph/CSP writes safely.

🤝 Custom Build

🎓 Ready to go deeper on MD-102?

Practice real MD-102 exam questions, study verified Microsoft Learn explanations, and test yourself in Pearson VUE simulator mode.

Free 10Q MD-102 Exam → Launch Simulator
📡

Don't miss the Friday Microsoft Endpoint & Security TV Digest

One email a week: the Intune, Entra & Windows changes that actually matter, the Alex & Sarah TV episode, and new production-ready PowerShell scripts. No spam, unsubscribe in one click.

Browse past TV episodes & issues →
Souhaiel Morhag
Souhaiel Morhag
Microsoft Endpoint & Modern Workplace Engineer

Souhaiel Morhag is a Microsoft Intune and endpoint management specialist with hands-on experience deploying and securing enterprise environments across Microsoft 365. He founded MSEndpoint.com to share practical, real-world guides for IT admins navigating Microsoft technologies — and built the MSEndpoint Academy at app.msendpoint.com/academy, a dedicated learning platform for professionals preparing for the MD-102 (Microsoft 365 Endpoint Administrator) certification. Through in-depth articles and AI-powered practice exams, Souhaiel helps IT teams move faster and certify with confidence.

Related Articles

Popular on MSEndpoint