{"id":3322,"date":"2014-04-03T08:05:28","date_gmt":"2014-04-03T08:05:28","guid":{"rendered":"http:\/\/www.top-password.com\/blog\/?p=3322"},"modified":"2014-04-03T08:15:40","modified_gmt":"2014-04-03T08:15:40","slug":"force-all-ad-user-accounts-to-change-passwords-at-next-logon","status":"publish","type":"post","link":"https:\/\/www.top-password.com\/blog\/force-all-ad-user-accounts-to-change-passwords-at-next-logon\/","title":{"rendered":"Force All AD User Accounts to Change Passwords at Next Logon"},"content":{"rendered":"<p>How can I force domain user account to change password at the next logon? Simply open <strong>Active Directory Users and Computers<\/strong> MMC snap-in (DSA.MSC) by selecting Start -> Administrative Tools -> Active Directory Users and Computers, and locate your desired AD user. Right-click on the account and select Properties. To force the account to change password, just tick the &#8220;<strong>User must change password at next logon<\/strong>&#8221; checkbox.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/04\/force-domain-user-to-change-password.png\" alt=\"force-domain-user-to-change-password\" width=\"424\" height=\"531\" class=\"alignnone size-full wp-image-3325\" \/><\/p>\n<p>Now you might ask: Is there a way of doing this for all users in a single OU? In this post I will show how to use a simple Powershell script to force all AD user accounts to change their password at next logon.<\/p>\n<p><strong>Tips:<\/strong> <em>If you forgot the AD administrator password and get locked out of your domain controller, you can reset the password by booting your server to <a style=\"text-decoration:underline;\" href=\"http:\/\/www.top-password.com\/reset-windows-password.html\">PCUnlocker Live CD<\/a>.<\/em><\/p>\n<p><strong>How to Force All AD User Accounts to Change Passwords at Next Logon?<\/strong><\/p>\n<p>Click Start and then navigate to All Programs -> Accessories -> Windows PowerShell. Right-click Windows PowerShell, and select <strong>Run as administrator<\/strong> from the context menu. <\/p>\n<p>Using both Get-ADUser and Set-ADUser commands you can force all domain user accounts in a OU to change their passwords at next logon. For this demo I&#8217;m using IT OU. The fully qualified domain name of our Windows domain is corp.top-password.com.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/04\/active-directory-users.png\" alt=\"active-directory-users\" width=\"550\" height=\"284\" class=\"alignnone size-full wp-image-3324\" \/><\/p>\n<p>The following command will force all users in the IT department to change password on login.<br \/>\n<strong>Get-ADUser -Filter * -SearchBase &#8220;OU=IT,DC=corp,DC=top-password,DC=com&#8221; | Set-ADUser -ChangePasswordAtLogon:$true<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2014\/04\/windows-powershell.png\" alt=\"windows-powershell\" width=\"550\" height=\"159\" class=\"alignnone size-full wp-image-3326\" \/><\/p>\n<p>However, this might cause some AD users to be locked of their computers if the &#8220;User Cannot Change Password&#8221; attribute is set. To avoid such problem, It&#8217;s better to also disable both &#8220;User Cannot Change Password&#8221; and &#8220;Password never expires&#8221; attributes.<\/p>\n<p><strong>Get-ADUser -Filter * -SearchBase &#8220;OU=IT,DC=corp,DC=top-password,DC=com&#8221; | Set-ADUser -CannotChangePassword:$false -PasswordNeverExpires:$false -ChangePasswordAtLogon:$true<\/strong><\/p>\n<p>After executing the PowerShell command and all your users will be forced to change their own password on their next restart. If you don&#8217;t allow the AD users to set a blank password, you can then set up a group policy for your own purpose, by following the steps described in our previous post: <a  style=\"text-decoration:underline;\" href=\"http:\/\/www.top-password.com\/blog\/how-to-change-active-directory-password-policy-in-windows-server-2008\/\">How to Change Active Directory Password Policy in Windows Server 2008<\/a>.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How can I force domain user account to change password at the next logon? Simply open Active Directory Users and Computers MMC snap-in (DSA.MSC) by selecting Start -> Administrative Tools -> Active Directory Users and Computers, and locate your desired AD user. Right-click on the account and select Properties. To force the account to change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[92,10],"tags":[1646,1645,1644],"class_list":["post-3322","post","type-post","status-publish","format-standard","hentry","category-active-directory-password","category-tips-tricks","tag-force-ad-users-to-change-password","tag-force-domain-users-to-change-password","tag-force-user-to-change-password-on-next-logon"],"_links":{"self":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/3322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/comments?post=3322"}],"version-history":[{"count":9,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/3322\/revisions"}],"predecessor-version":[{"id":3334,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/3322\/revisions\/3334"}],"wp:attachment":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/media?parent=3322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/categories?post=3322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/tags?post=3322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}