Category filter

Scripts to create users on Windows 10 devices

Some corporate devices might be used by more than one employee. As a result, an administrator might have to create separate user accounts on each device. Manually creating accounts on all the devices is a tedious task. Hexnode lets admins deploy scripts to get the job done.

Disclaimer:

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

Batch Script

Create user

E.g., To create a user Josh,


Net user Josh “” /add

Change username

You can change the name of the created user account by running the script given below.

Replace ‘Administrator’ with the current name of the user and ‘NewName’ with the new name of the user, respectively.

Change password

The following script can be used to change the password for the user account.

Replace “Username” and “NewPassword” with your user’s name and required password.

Change account type to Standard

Replace “Account Name” with your user account name.

Change account type to Administrator

Replace “Account Name” with your user account name.

Powershell Script

Create user

E.g. To create a user Josh,


New-LocalUser –Name “Josh” -NoPassword

Change username

You can change the name of the created user account by running the script given below.

Replace ‘Administrator’ with the current name of the user and ‘NewName’ with the new name of the user, respectively.

Change password

The following script can be used to change the password for the user account.

Replace “Username” and “NewPassword” with your user’s name and required password.

Change account type to Standard

Replace “Account Name” with your user account name.

Change account type to Administrator

Replace “Account Name” with your user account name.

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