Password Hash Sync - Change default password expiry

Jon Kilner 136 Reputation points
2025-04-28T09:29:54.07+00:00

I'm in in the process of reviewing the steps needed to migrate our ADFS federated domain to be 'managed' in Entra.

One of the differences I've noticed is that by default password hashes for sync'd users do not expire. I've read that we can amend this behaviour by setting CloudPasswordPolicyForPasswordSyncedUsersEnabled to true. With this, once a password is changed on-prem and sync'd to Entra, the hash will expire after 90 days.

My question is, is it possible to change the default 90 days to another number? Our on-prem password expiry is 120 days and I'd like to align the two. The preference would be to set Entra to 120 days as that's what our users are used to.

I appreciate guidance is to move away from password expiry. However, that's not an option for us at the moment.

Microsoft Security | Microsoft Entra | Microsoft Entra ID

Answer accepted by question author
Harshitha Eligeti 4,530 Reputation points Microsoft External Staff Moderator
2025-04-28T13:12:54.2733333+00:00

Hello @Jon Kilner
I understand that you are process of reviewing the steps needed to migrate our ADFS federated domain to Entra. One key difference is that password hashes for synced users don’t expire by default. However, enabling CloudPasswordPolicyForPasswordSyncedUsersEnabled makes the hash expire after 90 days once synced, aligning with our on-premises policy. Currently, our on-prem password expiration is 120 days, and you'd like to match that. But enabling this setting applies Entra’s default 90-day expiration policy.

If there are synchronized users that only interact with Microsoft Entra integrated services and must also comply with a password expiration policy, you can force them to comply with your Microsoft Entra password expiration policy by enabling the CloudPasswordPolicyForPasswordSyncedUsersEnabled feature (in the deprecated MSOnline PowerShell module it was called EnforceCloudPasswordPolicyForPasswordSyncedUsers.

EnforceCloudPasswordPolicyForPasswordSyncedUsers feature and update the Entra ID password policy to match On-premises Entra password expiry policy. For an example the default Entra ID password policy requires users to change their passwords every 90 days. If your policy in AD is also 90 days, the two policies should match. If the Entra policy is not 90 days, you can update the Entra password policy to match by using the Set-MsolPasswordPolicy PowerShell command. Set-MsolPasswordPolicy -DomainName -ValidityPeriod. Replace with your registered domain name in Azure Entra and with 120 to set the password validity period to 120 days.

In this instance, the password expiry for On-premises and Entra ID will be the same, therefore users will need to change their password when it expires. However, synchronized users won't be able change their password from Entra ID until you enabled Enable Azure Active Directory self-service password reset writeback to an on-premises environment otherwise user has to change their password from on-premises and wait for new Password Hash to get synchronized to Entra ID.

Note: Once EnforceCloudPasswordPolicyForPasswordSyncedUsers feature enabled, Azure AD does not go to each synchronized user to remove the Never Expire (DisablePasswordExpiration) value from the PasswordPolicies attribute. Instead, the Never Expire (DisablePasswordExpiration) value is removed from PasswordPolicies during the next password hash sync for each user, upon their next password change in on-premises AD.

For additional information refer this document: https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-password-hash-synchronization#cloudpasswordpolicyforpasswordsyncedusersenabled

Do Let us know if you have any Queries. We are happy to assist you further

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Obinna Ejidike 2,870 Reputation points Volunteer Moderator
    2025-04-28T12:01:59.08+00:00

    Hello Jon Kilner

    Thank you for the feedback.

    By default, for synced users, Entra does not enforce any password expiration unless you explicitly enable EnforceCloudPasswordPolicyForPasswordSyncedUsers.
    User's image

    The Update-MgDomain cmdlet enables you to ensure that both the on-prem and cloud password policies are the same.

    If the response was helpful, please feel free to mark it as “Accepted Answer” and consider giving it an upvote. This helps others in the community as well.

    Regards,

    Obinna.

    Was this answer helpful?

    0 comments No comments

Your answer

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