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.
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
-
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 -
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. -
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/MaintenanceWindowEnabledInteger 1 Turns the feature on Duration ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowDurationHoursInteger 4 Enough time for install and restart in most estates Start date ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartDateString 2026-11-28Anchor date for the first window; use your next intended cycle Start time ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowStartTimeString 01:00Off-hours local device time anchor Repeat option ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowRepeatScheduleOptionInteger Weekly value per build support Controls recurrence type; verify supported enum in your build testing Weekly Saturday ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklySaturdayInteger 1 Run the window on Saturday Weekly interval ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowWeeklyIntervalInteger 1 Every week Update actions ./Device/Vendor/MSFT/Policy/Config/Update/MaintenanceWindowUpdateActionsInteger Use the action value validated in your tenant/build Determines which update actions are allowed in-window Two settings need build-aware validation:
MaintenanceWindowRepeatScheduleOptionandMaintenanceWindowUpdateActions. Microsoft’s CSP reference identifies the nodes, but enum exposure and behavior can vary. Test those values on a pilot device and confirm the correspondingMaintenanceWindow*entries appear underHKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Update. -
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
-
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
-
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.
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:
# 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.