{"id":2515,"date":"2018-06-14T23:41:42","date_gmt":"2018-06-14T23:41:42","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2515"},"modified":"2018-06-14T23:41:42","modified_gmt":"2018-06-14T23:41:42","slug":"how-to-reset-pswds-for-ad-user-acct-via-powershell","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2515","title":{"rendered":"How to reset pswds for AD user acct via PowerShell"},"content":{"rendered":"<p>Open PowerShell in admin mode and enter the following:<\/p>\n<ul style=\"font-weight: 400;\">\n<li data-aria-posinset=\"1\" data-aria-level=\"2\">Make sure to have a .csv file with a column name of &#8220;Username&#8221; and &#8220;Password&#8221;<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">Import-Module\u00a0ActiveDirectory\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">$UserPwds\u00a0=\u00a0Import-CSV\u00a0C<b>:<\/b>\\users\\msgeek\\desktop\\Users.CSV\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><b>ForEach<\/b>($User\u00a0<b>in<\/b>\u00a0$UserPwds)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">{\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Set-adaccountpassword\u00a0$User.UserName\u00a0-reset -newpassword\u00a0(Convertto-Securestring\u00a0-asplaintext\u00a0$($User.Password) -force)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">}\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Open PowerShell in admin mode and enter the following: Make sure to have a .csv file with a column name of &#8220;Username&#8221; and &#8220;Password&#8221; &nbsp; &nbsp; Import-Module\u00a0ActiveDirectory\u00a0 $UserPwds\u00a0=\u00a0Import-CSV\u00a0C:\\users\\msgeek\\desktop\\Users.CSV\u00a0 ForEach($User\u00a0in\u00a0$UserPwds)\u00a0 {\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Set-adaccountpassword\u00a0$User.UserName\u00a0-reset -newpassword\u00a0(Convertto-Securestring\u00a0-asplaintext\u00a0$($User.Password) -force)\u00a0 }\u00a0 &nbsp; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,59],"tags":[],"class_list":["post-2515","post","type-post","status-publish","format-standard","hentry","category-ad","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2515","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=2515"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2515\/revisions"}],"predecessor-version":[{"id":2516,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2515\/revisions\/2516"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}