Hello! The use of a password is a common mechanism to increase security on Windows Server. Of course, this password must meet certain security parameters to be secure. Additionally, after some time it is likely that you will want to change it. Indeed, these changes can be implemented to the local or domain administrator. Additionally, a correctly configured password makes it more difficult to compromise the security of the server. However, there comes a time when it is advisable to modify these values. For this reason, today we will see how to do it using the Windows Server PowerShell. Come with me to see how to change password Local Administrator or Domain in Windows Server (PowerShell Via)
How to change the Local Administrator password using PowerShell
The first thing you have to do is open a PowerShell console as an administrator. You have two options for this:
- Press the Win+X combination or right click on the start button:
- Access directly from the Windows Server start menu:
With the following command, we will set a new password. In addition, we will convert the new value into an encrypted string:
$NewPassword = ConvertTo-SecureString "AnotherPassword" -AsPlainText -Force
Please remember to change the value “AnotherPassword” to the new password
How to change the password of a local user.
Then we will change the password of the local user. With this in mind, we will use the following command:
Set-LocalUser -Name Osradar1 -Password $AnotherPassword
Please note to replace User with the corresponding user name. In my case, the command would look like this:
How to change Domain Administrator password using PowerShell
The procedure for changing the domain administrator password is as follows. Once again from PowerShell, run the following command:
Set-ADAccountPassword user -NewPassword $AnotherPassword –Reset
Again, replace User with account name. Additionally, update the new password.
This is it! We have seen how to change password Local Administrator or Domain in Windows Server (PowerShell Via). On the other hand, by using PowerShell the procedure is faster and more expeditious. We hope that in this way, administrators can increase the security of their system. Okay, before I say goodbye, I invite you to see our post about enabling the remote desktop in Windows Server. So long!