Skip to content

Intune After Entra Import PR Review

Ed Mozley edited this page Nov 14, 2026 · 1 revision

Assets reach their Intune primary user after an Entra import too - PR review

PR #334 by vsc55 Β· Follows #236 (review) Β· Verdict: merge, one small fix Β· 5.3.0

Assign assets to their primary user in Intune matches a device's primary user to a person by Entra object id - which the device gets from an Intune sync and the person gets from an Entra import. It ran only at the end of an Intune sync, so anybody imported after it - a new starter, or everybody after an Entra source was set up again - waited, unassigned, for the next Intune sync. The order the two syncs ran in decided whether an asset got a holder. The Entra import now runs the same assignment when it finishes. User pages: Assets, Importing people from Entra ID. Internals: Asset reconciliation - Developer Guide Β§6b.

What was checked

Question How Result
Same rules as the Intune side? Read intuneAssignAfterDirectoryImport() Yes - it calls intuneAssignPrimaryUsers() itself: only an asset nobody holds, never a leaver, a retired asset, somebody from another company, or an asset whose devices disagree
Only when switched on? Read; the test Yes - it reads intune_assign_primary_user and returns null unless it is '1'
Can it break an import? Read No - wrapped in its own try, logged as [intune] assign primary users after a directory import, and the import carries on and reports success
In a preview? Read entraSyncRun() Never - only a live import
Does it need the Intune credentials? Read No - the devices' primary users are already in intune_devices; nothing calls Graph

tests/intune-primary-user.php on the test install: 12 checks pass (1 skipped - the other-company case needs a second company), in a transaction that is always rolled back, including the two new ones (nothing with the setting off; the same assignment with it on).

What was changed

  • The changelog row's id #2892 had already been used on main that day; the row is #2911, with the credit.
  • A sentence under the setting (Assets β†’ Settings β†’ Intune) and in the Assets help - it runs after every Intune sync and every Entra import, so it does not matter which runs first - in all nine maintained languages, and the write-up: the Assets page, the Entra import page, the reconciliation developer guide and this page.
  • No code was changed.

Worth knowing

  • The import's message says how many assets it gave out - Assets given to their Intune primary user: N. - only when it gave out at least one.
  • #335 (a history of each device's primary user, and assets that follow it) builds on this.

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally