A cloud-based identity and access management service for securing user authentication and resource access
Hi Divya M ,
This behavior is expected in hybrid environments. Even if the account is expired in on-prem AD, Microsoft Entra ID does not evaluate the accountExpires attribute during authentication, so users can still sign in to cloud applications.
To achieve your requirement without disabling the account, the recommended approach is to convert the expiry condition into an access control decision using attribute sync, automation, and policy enforcement. First, ensure that the accountExpires attribute is synchronized from on-prem AD to Entra ID using Microsoft Entra Connect, typically by mapping it to an extension attribute. Next, implement a scheduled automation (PowerShell or Azure Automation) that compares the expiry date with the current date and identifies users whose accounts have expired. These users should then be added to a dedicated security group (for example, “Expired-Users”), which will be used for access control.
You can implement this using the following steps:
- Sync the
accountExpiresattribute to Entra ID (via Entra Connect → extension attribute). - Create a security group (e.g., “Expired-Users”).
- Configure a scheduled script to:
- Read user expiry values
- Compare with current date
- Add expired users to the group (and optionally remove if updated)
- Create a policy in Conditional Access:
- Target → Expired-Users group
- Cloud apps → All apps
- Grant → Block access
With this setup, users whose accounts are expired in AD will be automatically identified and blocked from authenticating in Entra ID without disabling their accounts.
Kindly let us know if the above helps or you need further assistance on this issue.
If the answer is helpful, please "Accept the answer" and kindly "Upvote" it. If you have extra questions about this answer, please click "Comment".