diff --git a/authentik/sources/ldap/sync/vendor/ms_ad.py b/authentik/sources/ldap/sync/vendor/ms_ad.py index e8fdf831c8..fd02308973 100644 --- a/authentik/sources/ldap/sync/vendor/ms_ad.py +++ b/authentik/sources/ldap/sync/vendor/ms_ad.py @@ -78,7 +78,9 @@ class MicrosoftActiveDirectory(BaseLDAPSynchronizer): # /useraccountcontrol-manipulate-account-properties uac_bit = attributes.get("userAccountControl", 512) uac = UserAccountControl(uac_bit) - is_active = UserAccountControl.ACCOUNTDISABLE not in uac + is_active = ( + UserAccountControl.ACCOUNTDISABLE not in uac and UserAccountControl.LOCKOUT not in uac + ) if is_active != user.is_active: user.is_active = is_active user.save()