Skip to content
The record
Finding21 September 20266 min read

Windows management checks from a read-only registry: what Entra, domain and MDM enrolment can actually prove offline

Because the audit station boots Linux, dsregcmd, PowerShell and WMI are impossible and only the registry those tools would have read is available; the record sets out what is knowable from which hive, three mechanical traps in reading them, and why "Windows is activated" can never honestly be claimed.

systemssecuritymethod

What was done

The brief asked for Autopilot, Intune, Entra, domain and activation checks with "Run Check" buttons and dsregcmd; none of that is possible, because the station boots Linux and the machine's Windows is never running. Only the registry those tools would have read is available, parsed with hivex from a read-only mount, so the work was to establish what each hive can actually prove: CloudDomainJoin\JoinInfo for an Entra tenant, and the SECURITY hive — which the file had never opened, and which hivex reads as root because it parses the file and ignores the ACL — for the primary domain SID and name. Three mechanical traps each cost a session: the values sit in the key's unnamed default value, which needs hivexsh lsval rather than hivexget; they are UTF-16LE binary and bash drops NULs, so they must be stripped inside the pipeline; and a REG_BINARY printed as hex:04,00,... once produced the literal domain "hex" on a real audit. Five commits then closed false-positive traps, among them a tenant-GUID filter that dropped a valid GUID and reported PASS on a machine known to be enrolled, the conflation of Entra ID with Active Directory, and an Autopilot verdict that announced "No local Autopilot traces" after four reads against a hive it could not open. Two things are stated as impossible and never promised: "Windows is activated", and querying Autopilot registration, which lives in the registering tenant's Intune.

 

Windows volume mounted READ-ONLY (never booted) | v canary read: ProductName (in that key since NT) | | fails succeeds | | v v UNKNOWN key present? -> every install (not "nothing has the keys: not a signal was found") value content? -> DETECTED nothing in it? -> PASS

out of reach offline: "Windows is activated", Autopilot registration (in the tenant's Intune)

 

Three verdicts, not two, and a canary read that decides which of them the check is entitled to report.


Status

Shipped, 21 September 2026.

The problem

The operator asked for proper Autopilot / Intune / Entra / domain / activation checks, with "Run Check" buttons and dsregcmd.

The constraint that governs everything

The station boots Linux. The machine's Windows is never running.

lock-checks.sh mounts the Windows volume read-only and parses its hives with hivex. So dsregcmd /status, PowerShell, WMI and any live API are impossible — only the registry those tools would have read. This is not a limitation to engineer around; it is the shape of the problem.

What is knowable, and how

Entra ID (Azure AD) join — SYSTEM\<CtrlSet>\Control\CloudDomainJoin\JoinInfo\<sub>, carrying TenantId, TenantDisplayName, IdpDomain and DeviceId.

UserEmail is in that key and is never read. It is a former employee's identity and has no place on a resale audit. check_mdm set that precedent by keeping only the UPN domain.

Active Directory domain join — the SECURITY hive, which the file had never opened. Policy\PolPrDmS is the primary domain SID (a workgroup machine has none); PolPrDmN and PolDnDDN name the domain; Policy\Secrets\$MACHINE.ACC and the Cache\NL$n cached logons corroborate.

Readable offline as root because hivex parses the hive file and ignores the ACL that blocks a live reg query HKLM\SECURITY.

Three mechanical traps, each of which cost a debugging session:

  1. The values sit in the key's default (unnamed) value — hivexget cannot fetch it, it needs hivexsh lsval.
  2. They are binary UTF-16LE, and bash drops NULs — pipe through tr -d '\000'.
  3. hivex prints a REG_BINARY as hex:04,00,..., which the name extractor turned into the literal domain "hex" — fixed on 22 September in, after it appeared on a real audit.

The licence — ACPI MSDM/SLIC presence, and a configured KMS host. See 2026-09-20-hardware-profile-and-os-capture.md.

What is impossible, and must never be promised

"Windows is activated." Evaluated at runtime from sealed machine-bound stores; an expired KMS grant is indistinguishable on disk from a live one; a digital-licence machine can have nothing on disk at all.

Querying Autopilot registration. It lives in the registering tenant's Intune. No cross-tenant read, no anonymous endpoint. See 2026-09-22-autopilot-research.md.

The false-positive traps

Each verified against a clean, never-joined Windows 11. Testing key presence instead of value content calls every Windows machine domain-joined — every install carries the keys.

stop an Entra-joined machine reading as clear. A grep filter meant to validate a tenant GUID dropped a valid one, so the check found no tenant and reported PASS. Found on a real machine the operator knew was enrolled.

tell Entra ID and Active Directory apart, and name who owns the machine. The two had been conflated. They are different locks with different remedies, and the row now names the organisation.

stop Autopilot claiming it looked at a hive it could not open. Four reads against an unopenable hive returned four empty strings, and the verdict announced "No local Autopilot traces" — a claim to have looked. Found on a real machine whose MDM row, on the same audit, said the hive was unreadable.

five more checks that called a machine clean without looking: the MDM enrolment listing, UEFI setup mode on a legacy boot, a partial BitLocker scan, an unrecognised BIOS password flag, and a TPM ownership field absent from the output.

What was deliberately not built

No "Run Check" buttons that re-query live — there is nothing live to query. The checks run during the capture and the result is what the audit carries.

Nothing is ever removed. Detect → Verify → Report.

Open questions

The lock_locate_hives SOFTWARE gate is deliberate: SECURITY is missing on a damaged or part-copied install, and requiring it would turn every Windows check UNKNOWN over a hive only one of them needs. Each check reports what its own inputs allow.


The code

The fix that stopped a verdict claiming it had looked: prove the hive opens before reporting what is not in it.

# Prove the hive can be READ before reporting what is not in it.
#
# These reads come back empty in two completely different cases: the value is
# genuinely absent, or hivexget could not open the hive at all. They were
# indistinguishable, so a hive that would not open produced empty strings and
# the verdict announced "No local Autopilot traces" - a claim to have looked.
#
# ProductName has been in that key since NT, so failing to read IT means the
# hive is the problem, not the key.
if ! lock_hive_get "$WIN_SOFTWARE" \
     'Microsoft\Windows NT\CurrentVersion' ProductName >/dev/null 2>&1; then
  # ... the profile files and the OOBE log are ordinary files; read those ...
  lock_add autopilot "Windows Autopilot" UNKNOWN \
    "The SOFTWARE hive could not be read, so nothing can be concluded" \
    'offline registry + profile files + event log' low
  return
fi
From tools/lock-checks.sh — an excerpt, trimmed to the technique it illustrates.

Not shown. The tenant-GUID validation and the full key paths and value names behind the Entra, domain and MDM checks are left out: published, they are a checklist for scrubbing enrolment evidence off a machine before resale. No tenant, organisation or device identifier from any real audit appears. The UserEmail value sitting in the Entra join key is not shown because the tool never reads it — a former employee's identity has no place on a resale audit.

A published copy. Commit references and internal identifiers have been removed and the operator is not named; the engineering, the counts and the stated limits are unchanged.