<# .SYNOPSIS Intune Remediations DETECTION script (report only): the device-side reasons why the Intune "Secure Boot status" report can show a PC as Unknown or Not applicable. .DESCRIPTION READ-ONLY. Changes nothing on the device. No remediation script is needed. Microsoft's own sample script (Detect-SecureBootCertUpdateStatus.ps1, in %SystemRoot%\SecureBoot\ExampleRolloutScripts once the May 2026 update is installed) reads the certificate status, the events, the firmware and the Secure-Boot-Update task. It does not read the settings below. Microsoft's Secure Boot status report page says these can make a device show Unknown or Not applicable in the report: 1. The May 2026 Windows security update (or a later one) is not installed: "Devices must install the May 2026 Windows security update or a later cumulative update to send the Secure Boot required diagnostic data." 2. The diagnostic data policy (AllowTelemetry) is 0, diagnostic data off. The Policy CSP says 0 is only supported on Enterprise, Education and Server; on other editions it is equivalent to 1. Not configured means Required (Basic). 3. The policy DisableOneSettingsDownloads is on: "Don't enable the DisableOneSettingsDownloads CSP." 4. The Secure-Boot-Update scheduled task (\Microsoft\Windows\PI\Secure-Boot-Update) is disabled or deleted. It writes ONE line of JSON (under 300 characters; Intune keeps at most 2,048). It holds no user name and no personal data. Export the Remediations device status report and drop the CSV on the free "Secure Boot Triage" page on EndpointWeekly. Output example: {"v":1,"build":"26200.9974","ed":"Enterprise","may":"yes","diagGP":null,"diagMDM":1,"diagOff":false,"oneGP":null, "oneMDM":null,"oneOff":false,"task":"Ready","causes":[],"err":""} may = yes (the May 2026 update or later is installed) | no | ended (this Windows version stopped receiving updates before May 2026) | unknown (a build this script has no row for; it never guesses) diagGP / diagMDM = the AllowTelemetry value found in the Group Policy key and in the PolicyManager (Intune) key, or null oneGP / oneMDM = the DisableOneSettingsDownloads value found there, or null causes = the problems found: may, ended, diag, one, task. Empty means none of the four applies on this PC. err = "run-in-64-bit-powershell" or "read-error": something could not be read, so do not trust "no problem". Exit code: 1 when a cause was found or something could not be read (Intune lists the PC under "With issues"); 0 otherwise. Intune settings: Run this script using the logged-on credentials = No (runs as SYSTEM), Run script in 64-bit PowerShell = Yes, leave the remediation script empty, schedule = Daily. What it cannot see: the tenant setting for the Windows diagnostic data processor configuration (DPSW), the network access to Microsoft's diagnostic endpoints, and whether a PC was inactive for more than 28 days. The free page covers the last one. .NOTES Version 1.0, 2 December 2026. EndpointWeekly free tools: https://endpointweekly.com/tools.html ASCII only. Windows PowerShell 5.1 and PowerShell 7. #> [CmdletBinding()] param() $ErrorActionPreference = 'Stop' # ---- tables: Microsoft Learn release information for Windows 11 and Windows 10, checked 2 December 2026 ---- # The May 2026 "B" update (released 12 May 2026): the lowest revision (UBR) that has it, per Windows build. $MayRevision = @{ '14393' = 9140; '17763' = 8755; '19044' = 7291; '19045' = 7291; '22631' = 7079; '26100' = 8457; '26200' = 8457; '28000' = 2113 } # Builds whose newest update came out before 12 May 2026: they can never get the May 2026 update. $OutOfService = @('10240', '10586', '15063', '16299', '17134', '18362', '18363', '19041', '19042', '19043', '22000', '22621') # Builds first released after 12 May 2026: every update of them is newer than the May 2026 update. $AfterMay = @('26300') $err = '' if ($env:PROCESSOR_ARCHITEW6432) { # a 32-bit PowerShell on a 64-bit Windows reads HKLM\SOFTWARE from the WOW6432Node view: the answers would be wrong $err = 'run-in-64-bit-powershell' } $readErrors = New-Object System.Collections.ArrayList function Get-RegValue([string]$Path, [string]$Name) { try { $p = Get-ItemProperty -Path $Path -Name $Name -ErrorAction Stop return $p.$Name } catch { $m = [string]$_.Exception.Message if ($_.Exception -is [System.Management.Automation.ItemNotFoundException] -or $_.Exception -is [System.Management.Automation.PSArgumentException] -or $m -match 'does not exist|Cannot find path') { return $null } [void]$script:readErrors.Add($Name) return $null } } function Get-TaskStatus { try { $out = schtasks.exe /Query /TN '\Microsoft\Windows\PI\Secure-Boot-Update' /FO CSV 2>&1 if ($LASTEXITCODE -ne 0) { return 'NotFound' } $row = @($out | ConvertFrom-Csv)[0] if ($row -and $row.Status) { return [string]$row.Status } return 'Unknown' } catch { return 'Error' } } $cv = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' $base = [string](Get-RegValue $cv 'CurrentBuildNumber') $ubrRaw = Get-RegValue $cv 'UBR' $edition = [string](Get-RegValue $cv 'EditionID') # 1. the May 2026 update $may = 'unknown' $build = $base if ($base) { if ($null -ne $ubrRaw) { $build = $base + '.' + [string]$ubrRaw } if ($AfterMay -contains $base) { $may = 'yes' } elseif ($MayRevision.ContainsKey($base) -and $null -ne $ubrRaw) { if ([int]$ubrRaw -ge [int]$MayRevision[$base]) { $may = 'yes' } else { $may = 'no' } } elseif ($OutOfService -contains $base) { $may = 'ended' } } # 2. diagnostic data policy: documented key (Group Policy) and the PolicyManager key where Intune policies land $gpKey = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection' $mdmKey = 'HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\System' $diagGP = Get-RegValue $gpKey 'AllowTelemetry' $diagMDM = Get-RegValue $mdmKey 'AllowTelemetry' $eligible = $edition -match '^(Enterprise|Education|Server)' $diagOff = [bool]((($diagGP -eq 0) -or ($diagMDM -eq 0)) -and $eligible) # 3. OneSettings downloads policy $oneGP = Get-RegValue $gpKey 'DisableOneSettingsDownloads' $oneMDM = Get-RegValue $mdmKey 'DisableOneSettingsDownloads' $oneOff = [bool](($oneGP -eq 1) -or ($oneMDM -eq 1)) # 4. the scheduled task Windows uses to apply the certificate update $task = Get-TaskStatus if ($task -eq 'Error') { [void]$readErrors.Add('task') } if (-not $err -and $readErrors.Count -gt 0) { $err = 'read-error' } $causes = New-Object System.Collections.ArrayList if ($may -eq 'no') { [void]$causes.Add('may') } if ($may -eq 'ended') { [void]$causes.Add('ended') } if ($diagOff) { [void]$causes.Add('diag') } if ($oneOff) { [void]$causes.Add('one') } if ($task -eq 'Disabled' -or $task -eq 'NotFound') { [void]$causes.Add('task') } $obj = [ordered]@{ v = 1; build = $build; ed = $edition; may = $may diagGP = $diagGP; diagMDM = $diagMDM; diagOff = $diagOff oneGP = $oneGP; oneMDM = $oneMDM; oneOff = $oneOff task = $task; causes = @($causes); err = $err } Write-Output ($obj | ConvertTo-Json -Compress) if ($err -or $causes.Count -gt 0) { exit 1 } exit 0