Skip to content

Intune Anomalies 1.2.2: APv2, Cloud PC exclusion, tab banners, readable noncompliant reasons - #9

Merged
royklo merged 4 commits into
mainfrom
fix/intune-anomalies-1.2.2
Sep 24, 2026
Merged

royklo merged 4 commits into
mainfrom
fix/intune-anomalies-1.2.2

Conversation

@royklo

@royklo royklo commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Noncompliant tab: reasons no longer show "Unknown" for Default Device Compliance Policy failures, and use the Intune admin-center names (with the tenant's validity period for Is active).
  • Autopilot tab (renamed Not in Autopilot): devices registered via Autopilot device preparation (corporate identifiers) are no longer flagged.
  • Cloud PCs / Dev Boxes are left out of the BitLocker and Autopilot tabs (detected via deviceType: cloudPC).
  • Every tab has a banner explaining what it checks.
  • Application failures: percentages were 100x too small.
  • ModuleVersion 1.2.2, CHANGELOG, and Gallery ReleaseNotes for 1.2.0-1.2.2.

No new Graph permissions.

Test plan

  • Invoke-Pester ./Tests/: 13/13 (2 new tests for the reason names)
  • PSScriptAnalyzer: no new warnings vs main
  • Report generated against the Inforcer tenant: 26/27 noncompliant rows have a reason (the remaining device reports no policy states in Graph), percentages match Intune, 0 Cloud PCs on BitLocker/Autopilot tabs (16 detected)
  • Visual check in browser

Note: the deviceType lookup adds one batched GET per device

Roy Klooster and others added 3 commits September 24, 2026 12:09
…ery tab

- Autopilot tab ("Not in Autopilot") now also treats corporate identifiers
  (Autopilot device preparation) as registered.
- Cloud PCs / Dev Boxes (deviceType cloudPC, per-device lookup) are left out
  of the BitLocker and Autopilot tabs.
- Every tab gets a banner describing what it checks.
- Noncompliant reasons use Intune admin-center names; "Is active" shows the
  tenant's compliance status validity period.
- fix: Default Device Compliance Policy rules no longer show as "Unknown"
  (Graph leaves `setting` empty; rule is in `settingName`).
- fix: application failure percentages were divided by 100 twice.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Autopilot lookup failures and composite identifiers can misclassify devices, and tenant validity state may persist across reports.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Updates Intune Anomalies 1.2.2 with Autopilot device-preparation handling, Cloud PC exclusions, clearer compliance reasons, tab banners, and corrected application percentages.

Changes:

  • Adds corporate-identifier and Cloud PC detection.
  • Improves compliance reason labels and validity-period display.
  • Updates tests, documentation, release notes, and module version.
File Description
Tests/​Consistency.Tests.ps1 Adds compliance-name consistency tests.
module/​RKSolutions.psd1 Bumps version and release notes.
module/​Public/​Get-IntuneAnomaliesReport.ps1 Excludes Cloud PCs and APv2 devices appropriately.
module/​Private/​IntuneAnomalies.ps1 Adds device classification, friendly names, banners, and percentage fixes.
module/​Private/​Get-RKSolutionsReportTemplate.ps1 Adds tab-intro styling.
docs/​CMDLET-REFERENCE.md Updates report description.
CHANGELOG.md Documents 1.2.2 changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# Autopilot device preparation (v2) associates devices via corporate identifiers
# ("Manufacturer,Model,Serial" or a bare serial) instead of a hardware hash.
$CorporateIdentifierSerials = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::OrdinalIgnoreCase)
$CorporateIdentifiers = Invoke-GraphRequestWithPaging -Uri "https://graph.microsoft.com/beta/deviceManagement/importedDeviceIdentities"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional. If the lookup fails, APv2 devices fall back to being listed, which is the pre-1.2.2 behaviour, so it fails open (more rows, never hidden ones). The existing Autopilot hash lookup uses the same helper with the same behaviour. Surfacing failures from Invoke-GraphRequestWithPaging is a module-wide change and out of scope here.

Comment thread module/Private/IntuneAnomalies.ps1 Resolved
The friendly-name map is module-scoped, so a failed settings lookup could
show the previous tenant's day count in the same session.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 24, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The corporate-identifier query may be incomplete, causing devices to be incorrectly reported as not in Autopilot.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

@royklo
royklo merged commit 024aaeb into main Sep 24, 2026
3 checks passed
@royklo
royklo deleted the fix/intune-anomalies-1.2.2 branch September 24, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants