Using Windows 10 passwords is one of the most popular mechanisms for adding security to Windows Server access . This password must meet certain access parameters and it is normal that after a while we want to change the Windows Server password, either from the local administrator or from the domain. We usually do this from the Server Administrator in the section " Active Directory Users and Computers " but today we will see how to change this password from PowerShell..
Having a Windows Server password configured in our accounts makes it more difficult for other users to access our information. Although sometimes it is not difficult to remember so many passwords, the truth is that we must change the passwords regularly in Windows 10 to avoid making it easier to guess.
We also leave you the video tutorial to know how to change the password of Local Administrator or Domain with PowerShell..
To stay up to date, remember to subscribe to our YouTube channel! SUBSCRIBE
1. How to change Local Administrator password in PowerShell
The first step will be to access PowerShell as administrators by right-clicking the Start button and selecting "Windows PowerShell (Administrator)":
Now in the PowerShell console and in the first command we are going to convert the new password into an encrypted string using the following command:
$ NewPassword = ConvertTo-SecureString "P @ ssw0rd" -AsPlainText -Force
In the field "P @ ssw0rd" we can add the desired:
After this we will change the password of your local account using the following command:
Set-LocalUser -Name User -Password $ NewPassword
In the User field we must enter the name of the user to change, in this case we will put the username Local Administrator of the team that we want to change the password.
2. How to change Domain Administrator password in PowerShell
In case you want to change the password of a user's domain we must execute the following:
Set-ADAccountPassword user -NewPassword $ NewPassword –Reset
We replace user with the account name:
With this process we can change the password of a user either locally or in the domain in Windows Server and have an alternative method to that already known to all, remember to use strong passwords.