Microsoft Entra ID
General

Import ADSyncTools module

In brief

The documentation replaces a direct Microsoft Graph beta PATCH request with Microsoft Graph PowerShell cmdlets, including the `OnPremDirectorySynchronization.ReadWrite.All` scope. It now sets `AllowOnPremUpdateOfOnPremisesObjectIdentifierEnabled` to `$true` temporarily and explains that `$false` re-enables hard match protection.

What Entra admins need to know

Administrators following this procedure should use the revised commands and account for the required Graph permission and temporary protection change.

This editorial summary was generated by AI from the documentation changes. Verify important details in the full Microsoft Learn article.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Alternatively, to clear onPremisesObjectIdentifier with ADSyncTools version 2.5.0 or later, run the following commands:

# Import ADSyncTools module
Import-Module ADSyncTools

# Provide the user's identity.
$userId = "<userId>"

If you can't remediate affected objects before enforcement, enable the tenant-level feature flag `allowOnPremUpdateOfOnPremisesObjectIdentifierEnabled`. This flag is disabled by default. Leave the flag disabled unless you need a temporary bypass while you complete remediation.

```powershell
$baseUri =# Connect to Microsoft Graph
Connect-MgGraph -Scopes "https://graph.microsoft.com/betaOnPremDirectorySynchronization.ReadWrite.All"

$onPremSync# Temporary Disable allowOnPremUpdateOfOnPremisesObjectIdentifierEnabled
$DirectorySync = Get-MgDirectoryOnPremiseSynchronization
$uri = "$baseUri/directory/onPremisesSynchronization/$($onPremSync.Id)"
$params = @{
    features = @{
        allowOnPremUpdateOfOnPremisesObjectIdentifierEnabled$DirectorySync.Features.AllowOnPremUpdateOfOnPremisesObjectIdentifierEnabled = $true }
}
Invoke-MgGraphRequest -Method PATCH -Uri $uri -Body $params
(Get-MgDirectoryOnPremiseSynchronization).# To re-enable hard match protection, set it $false
Update-MgDirectoryOnPremiseSynchronization -Features $DirectorySync.Features | fl-OnPremisesDirectorySynchronizationId $DirectorySync.Id

# Get AllowOnPremUpdateOfOnPremisesObjectIdentifierEnabled value
$DirectorySync = Get-MgDirectoryOnPremiseSynchronization
$DirectorySync.Features.AllowOnPremUpdateOfOnPremisesObjectIdentifierEnabled
Daily Entra.News

Get daily email updates

Get a concise summary of the latest Microsoft Entra updates delivered straight to your inbox.

Loading the secure signup form…