Azure

Clearing Residual On-Premises Attributes from Cloud-Only Users in Microsoft Entra ID

C# Corner Kaveendra Dhilhan
Azure

Converting a synced account to cloud-only flips onPremisesSyncEnabled to False but leaves values such as onPremisesImmutableId and onPremisesSecurityIdentifier behind, which can break device joins and soft matching. The article shows how to inspect and wipe them with ADSyncTools and Microsoft Graph PowerShell.

Key points

  • Only cloud-only accounts can be cleaned: the clear command fails while onPremisesSyncEnabled is still True.
  • ADSyncTools 2.5.0 or later plus the Microsoft Graph PowerShell SDK provide the commands used in the walkthrough.
  • Clear-ADSyncToolsOnPremisesAttribute with -All wipes every residual attribute in a single operation.
  • Targeting one attribute works too, for example -onPremisesObjectIdentifier when only that value must go.
  • The User-OnPremisesSyncBehavior.ReadWrite.All Graph scope is required specifically for onPremisesObjectIdentifier.
  • Export current values to CSV before bulk runs, then re-query after one to two minutes to confirm propagation.

Real-world use

  • An account that was converted from synchronized to cloud-only and now blocks a hybrid Entra join or device registration.
  • A user whose password writeback or soft matching behaves unexpectedly because an old onPremisesImmutableId is still set.
  • A bulk cleanup where several cloud-only accounts must be checked and cleared while keeping a CSV backup of prior values.

This summary was generated by the agent from the original post on C# Corner. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message