AAD Connect sync - Why accounts disabled in on-prem AD not disabled in Azure AD

Johnmen Zhang 5 Reputation points
2023-03-17T01:07:56.65+00:00

Hi there,

I have a client who is using AAD Connect sync 2.1.20 to sync accounts from on-prem AD to Azure AD.

I have recently discovered that some of the disabled accounts in on-prem AD don't have their synced entities disabled in Azure AD, in other words these accounts are still enabled in Azure AD.

I ran the Azure AD Connect Single Object Sync PowerShell script to diagnose the problem. The report generated shows that AAD Connect finds the AD account has the UserAccountControl value of 0x202, which means "Normal account" (0x200) + "Disabled" (0x002). However, with the default transformation rule the imported object to the AAD Connector space have "accountEnabled" attribute ended up as "True", which subsequently resulted in the account in AAD not disabled.

The default transformation rule is:Transformation_Rule

IIF(BitAnd([userAccountControl],2)=0,True,False)

With the "userAccountControl" value being 0x202, this rule should result in "False", yet the resulted "userEnabled" value was "True".

Can someone let me know what happened here?

Regards.

Johnmen

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} vote

3 answers

Sort by: Most helpful
  1. Simon Pretty 10 Reputation points
    2023-08-04T07:53:46.3633333+00:00

    Have also been stuck on this for quite some time...... found a solution. I deleted the original rule (precedence 106) and moved my cloned rule to precedence 106 and run a delta sync. Now my disabled users are showing in AAD as expected.

    2 people found this answer helpful.

  2. Johnmen Zhang 5 Reputation points
    2023-03-21T02:15:07.7966667+00:00

    Hi Andy,

    We cloned the default "In from AD - User Common" rule in order to add an attribute to determine if a user should be hidden from Exchange GAL. The transformations screenshot was taken from the cloned rule.

    Here is the default rule we cloned from, it has been disabled:

    2Bax0xhDWS

    Here is the rule we created from the clone:alPC5qIVhI

    Regards.

    Johnmen

    0 comments No comments

  3. Samuel Mannhart 5 Reputation points
    2023-07-18T06:27:53.8266667+00:00

    Hi there,

    Is there already a solution for this? We habe the exactly same problem.

    Regards,

    Samuel

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.