### FILE: index.php "; echo "

{$icon} {$title}

"; echo "

{$value}

"; if ($trendValue !== null) { echo "

{$trendValue}

"; } if ($progress !== null) { echo "{$progress}%"; } echo ""; } try { $updateRings = graphCall('/beta/deviceManagement/updateRingConfigurations', $accessToken); foreach ($updateRings['value'] as $ring) { $trend = $ring['autoRestartBeforeDeadline'] ? 'up' : 'down'; render_premium_card($ring['displayName'], json_encode($ring), null, $trend); } } catch (Exception $e) { echo "Error: " . $e->getMessage(); } ?> ### FILE: scripts/Automation.ps1 #Requires -Modules Microsoft.Graph.DeviceManagement, Microsoft.Graph.Groups <# .SYNOPSIS Validates and optionally remediates Intune update ring configurations for auto-restart compliance. .DESCRIPTION This script connects to Microsoft Graph to enumerate Intune update ring configurations, identify misconfigurations, and optionally updates settings to ensure compliance. .EXAMPLE .\Automation.ps1 -RemediateNullDeadlines #> param( [Parameter(Mandatory = $false)] [switch]$RemediateNullDeadlines, [Parameter(Mandatory = $false)] [int]$DefaultQualityDeadlineDays = 5, [Parameter(Mandatory = $false)] [int]$DefaultFeatureDeadlineDays = 10, [Parameter(Mandatory = $false)] [int]$DefaultGracePeriodDays = 2, [Parameter(Mandatory = $false)] [string]$ExportPath = "$env:TEMP\WUfB_Validation_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv" ) <## Credentials and connection Set up authentication and connect to Microsoft Graph ##> try { Connect-MgGraph -Scopes @( "DeviceManagementConfiguration.Read.All", "DeviceManagementManagedDevices.Read.All", "Group.Read.All", "DeviceManagementConfiguration.ReadWrite.All" ) -ErrorAction Stop Write-Verbose "[AUTH] Connected to Microsoft Graph" } catch { Write-Error "[AUTH FAIL] Unable to connect to Microsoft Graph: $_" exit 1 } try { # Gather update ring configurations $updateRings = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/deviceManagement/updateRingConfigurations?`\$select=id,displayName,deadlineForQualityUpdatesInDays,deadlineForFeatureUpdatesInDays,deadlineGracePeriodInDays,autoRestartBeforeDeadline,deadlineNoAutoReboot,assignments" -OutputType PSObject -ErrorAction Stop foreach ($ring in $updateRings.value) { # Evaluate each update ring for compliance $issues = @() if (-not $ring.autoRestartBeforeDeadline) { $issues += "AUTO_RESTART_DISABLED" } if ($null -eq $ring.deadlineForQualityUpdatesInDays) { $issues += "NULL_QUALITY_DEADLINE" } if ($null -eq $ring.deadlineForFeatureUpdatesInDays) { $issues += "NULL_FEATURE_DEADLINE" } if ($null -eq $ring.deadlineGracePeriodInDays) { $issues += "NULL_GRACE_PERIOD" } if ($issues.Length -gt 0) { Write-Warning "[RING ISSUE] $($ring.displayName): $($issues -join ', ')" # Optionally fix any issues found if ($RemediateNullDeadlines -and $PSCmdlet.ShouldProcess($ring.displayName, "Patch NULL deadline values")) { $patchBody = @{ autoRestartBeforeDeadline = $true deadlineForQualityUpdatesInDays = $DefaultQualityDeadlineDays deadlineForFeatureUpdatesInDays = $DefaultFeatureDeadlineDays deadlineGracePeriodInDays = $DefaultGracePeriodDays } try { # Update ring Invoke-MgGraphRequest -Method PATCH -Uri "https://graph.microsoft.com/beta/deviceManagement/updateRingConfigurations/$($ring.id)" -Body ($patchBody | ConvertTo-Json -Depth 3) -ContentType "application/json" -ErrorAction Stop Write-Host "[REMEDIATED] $($ring.displayName)" -ForegroundColor Green } catch { Write-Warning "[PATCH FAIL] $($ring.displayName): $_" } } } } } catch { Write-Error "[GRAPH FAIL] Unable to retrieve Update Ring configurations: $_" exit 1 } <## .NOTES Author: Souhaiel Morhag Company: MSEndpoint.com Blog: https://msendpoint.com Academy: https://app.msendpoint.com/academy LinkedIn: https://linkedin.com/in/souhaiel-morhag GitHub: https://github.com/Msendpoint License: MIT ##>