{"id":3189,"date":"2022-02-14T17:22:29","date_gmt":"2022-02-14T23:22:29","guid":{"rendered":"https:\/\/microsoftgeek.com\/?p=3189"},"modified":"2022-02-14T17:22:29","modified_gmt":"2022-02-14T23:22:29","slug":"comply-your-ad-password-expiration-policy-with-azure-ad","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=3189","title":{"rendered":"Comply your AD password expiration policy with Azure AD"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"how-does-enforcecloudpasswordpolicyforpasswordsyncedusers-policy-works\">How does EnforceCloudPasswordPolicyForPasswordSyncedUsers policy works?<\/h2>\n\n\n\n<p>If you have an expiration policy configured in your on-premise environment, this is not synced to Azure AD. This results in the scenario where a user can continue to work and access company resources when authenticating against Azure AD, although the password has expired in the on-premise AD. If you want to be able to have the moment of expiration of both passwords in sync, you should consider implementing this feature.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-should-i-use-the-enforcecloudpasswordpolicyforpasswordsyncedusers-feature\">Why should I use the EnforceCloudPasswordPolicyForPasswordSyncedUsers feature?<\/h2>\n\n\n\n<p>Many organizations who are using password hash synchronization and syncing their identities from AD to Azure AD are not aware of the consequences of an expired password. The expiration policy within Azure AD should comply with your on-premise AD, therefore you need to configure the EnforceCloudPasswordPolicyForPasswordSyncedUsers feature before it would mark a password as expired<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-enable-enforcecloudpasswordpolicyforpasswordsyncedusers-feature\">How to enable EnforceCloudPasswordPolicyForPasswordSyncedUsers feature?<\/h2>\n\n\n\n<p>Below you will find step-by-step guidance on how to enable and configure this feature.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Run the below Powershell command to check if the feature is enabled:<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-MsolDirSyncFeatures<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bilalelhaddouchi.nl\/wp-content\/uploads\/2020\/08\/FeatureEnabledOrDisabled.png\" alt=\"If the feature is disabled you should see the above &quot;false&quot;value\" class=\"wp-image-285\" width=\"752\" height=\"247\"\/><figcaption><em>If the feature is disabled you should see the \u201cfalse\u201d value, as is displayed in this screenshot.<\/em><\/figcaption><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li><strong>To enable the EnforceCloudPasswordPolicyForPasswordSyncedUsers, run the below command in your tenant:<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-MsolDirSyncFeature\u202f-feature\u202fEnforceCloudPasswordPolicyForPasswordSyncedUsers $true<\/code><\/pre>\n\n\n\n<p>By&nbsp;<strong>default<\/strong>, the value&nbsp;<strong>DisablePasswordExpiration&nbsp;<\/strong>is set for every synced user, which means that the password expiration does not comply with the on-premise AD policy. This results in the scenario that a user won\u2019t be prompted to change the password when they try to access company resources.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li><strong>Run the below command to check which user has a password expiration set:<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-AzureADUser | Select-Object UserPrincipalName,passwordpolicies<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"265\" src=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/2.png\" alt=\"\" class=\"wp-image-3191\" srcset=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/2.png 679w, https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/2-300x117.png 300w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/a><\/figure>\n\n\n\n<p>When you want to comply with the on-premise password expiration policy, the PasswordPolicies value should be set to None. To get this done, you should change the on-premise password of a user and start initial sync. After the sync, the value should change to \u201cNone\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"260\" src=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/3.png\" alt=\"\" class=\"wp-image-3192\" srcset=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/3.png 678w, https:\/\/microsoftgeek.com\/wp-content\/uploads\/2022\/02\/3-300x115.png 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/a><figcaption><em>The password policy is changed to \u201cNone\u201d because of an on-premise password change.<\/em><\/figcaption><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li><strong>Run the below command to change the value manually to \u201cNone\u201d for a specific user:<\/strong><\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-AzureADUser -ObjectID YourUserName -PasswordPolicies None<\/code><\/pre>\n\n\n\n<p><strong>Important note:<\/strong><br>If you have specific synchronized AD accounts, e.g. Service Accounts that need to have non-expiring passwords in Azure AD, you must explicitly add the DisablePasswordExpiration value to the PasswordPolicies attribute.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How does EnforceCloudPasswordPolicyForPasswordSyncedUsers policy works? If you have an expiration policy configured in your on-premise environment, this is not synced to Azure AD. This results in the scenario where a user can continue to work and access company resources when authenticating against Azure AD, although the password has expired in the on-premise AD. If you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,69],"tags":[],"class_list":["post-3189","post","type-post","status-publish","format-standard","hentry","category-ad","category-azure"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3189"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3189\/revisions"}],"predecessor-version":[{"id":3193,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3189\/revisions\/3193"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}