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.

Disclaimer:

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

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

Notes:

  • 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