Category filter

Script to change password of a user account on Windows 10 devices

Users forgetting their device password is a common scenario for an IT admin. Hexnode lets admins to change the password of users by deploying scripts.


The Sample Scripts provided below are adapted from third-party Open-Source sites.

Batch Script

E.g., To edit the password of the user, Josh to abc_123,

Net user josh abc_123

Reset the password a specific user

The command resets the password of the user <username> with the specified <password>.

PowerShell Script

E.g., To edit the password of user, Josh to abc_123,

$NewPassword = ConvertTo-SecureString "abc_123" -AsPlainText –Force
Set-LocalUser -Name Josh -Password $NewPassword

Reset password of a specific user

You can reset the password of a user account by passing its username and the new password as <UserName> and <password> respectively.


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository