{"id":14201,"date":"2019-04-25T03:08:26","date_gmt":"2019-04-25T03:08:26","guid":{"rendered":"https:\/\/www.top-password.com\/blog\/?p=14201"},"modified":"2019-04-25T03:13:07","modified_gmt":"2019-04-25T03:13:07","slug":"change-local-domain-admin-password-using-powershell","status":"publish","type":"post","link":"https:\/\/www.top-password.com\/blog\/change-local-domain-admin-password-using-powershell\/","title":{"rendered":"How to Change Local \/ Domain Admin Password Using Windows PowerShell"},"content":{"rendered":"<p>Need to write a PowerShell script for changing a local account&#8217;s password? We&#8217;ve covered <a href=\"https:\/\/www.top-password.com\/knowledge\/change-windows-10-password.html\" rel=\"noopener noreferrer\" target=\"_blank\">various ways of resetting Windows password<\/a> in the past, but this tutorial will teach you how to change the password of either local account or domain account using Windows PowerShell.<\/p>\n<p><strong>How to Change Local \/ Domain Admin Password Using PowerShell<\/strong><\/p>\n<ol>\n<li><a href=\"https:\/\/www.top-password.com\/blog\/5-ways-to-run-powershell-as-administrator-in-windows-10\/\" rel=\"noopener noreferrer\" target=\"_blank\">Open Windows PowerShell as Administrator<\/a>.\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2017\/06\/windows-powershell-admin.png\" alt=\"\" width=\"271\" height=\"613\" class=\"alignnone size-full wp-image-9511\" \/>\n<\/li>\n<li>First, you have to convert your new password to encrypted string by running the following command. Be sure to replace <em>P@ssw0rd<\/em> with the new password you want to set for your account.\n<p><code>$NewPassword = ConvertTo-SecureString \"P@ssw0rd\" -AsPlainText -Force<\/code>\n<\/li>\n<li>Next, type the following command to change your local account password. Substitute <em>Tom<\/em> in the command below with the actual user name of the local account that you want to change the password of.<br \/>\n<code>Set-LocalUser -Name Tom -Password $NewPassword<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2019\/04\/change-local-account-password-with-powershell.png\" alt=\"\" width=\"573\" height=\"150\" class=\"alignnone size-full wp-image-14206\" \/><\/p>\n<p>If you need to change domain user password, run the following command instead:<br \/>\n<code>Set-ADAccountPassword Tom -NewPassword $NewPassword \u2013Reset<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.top-password.com\/blog\/wp-content\/uploads\/2019\/04\/change-domain-user-password-with-powershell.png\" alt=\"\" width=\"563\" height=\"143\" class=\"alignnone size-full wp-image-14207\" \/>\n<\/li>\n<li>After completing the above steps, reboot your computer and you can log in to your local \/ domain account with the new password.<\/li>\n<\/ol>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Need to write a PowerShell script for changing a local account&#8217;s password? We&#8217;ve covered various ways of resetting Windows password in the past, but this tutorial will teach you how to change the password of either local account or domain account using Windows PowerShell. How to Change Local \/ Domain Admin Password Using PowerShell Open [&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,1,10,1894,3,39],"tags":[4193,4192,4194],"class_list":["post-14201","post","type-post","status-publish","format-standard","hentry","category-active-directory-password","category-others","category-tips-tricks","category-windows-10","category-windows-7","category-windows-8","tag-powershell-change-domain-password","tag-powershell-change-local-user-password","tag-powershell-script-to-change-password"],"_links":{"self":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/14201","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=14201"}],"version-history":[{"count":11,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/14201\/revisions"}],"predecessor-version":[{"id":14214,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/posts\/14201\/revisions\/14214"}],"wp:attachment":[{"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/media?parent=14201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/categories?post=14201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.top-password.com\/blog\/wp-json\/wp\/v2\/tags?post=14201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}