Use the guides below to alter Windows user accounts from the command line. For most of the commands to run you will need to run the command prompt as an administrator otherwise you will get an Access Is Denied error when running
Open Command Prompt as Administrator
- Click on the Start Menu and type CMD
- In the search results you will see the Command Prompt
- Right Click on Command Prompt and select Run As Administrator
- Click Yes on the User Account Control Window
- Command Prompt will now be open as an Administrator
Obtain A list of User Accounts
You can generate a list of user accounts from the command line using the commands below.
After entering the “net user” command a user list will be output. The example below shows the laptop has 4 user accounts (Administrator, DefaultAccount, Guest and WDAGUtilityAccount). Some of the accounts are System Accounts and are likely disabled. You can check the properties of each account including whether they are enabled or disabled using the command net user "username"
net user |
Create A New User Account
New user accounts can also be created via the command line using the following commands. The example below creates a new user called ITWalkthroughs with the password set as LetMeIn
net user /add NewUsername NewPassword |
Delete A User Account
You can also delete users from the command line using the command below, all you need to know is the username. The example below deletes the user account ITWalkthroughs
net user "UserName" /delete |
Enable or Disable A User Account
You can also enable or disable user accounts using the following commands. The example below enables the user account ITWalkthroughs
Enable a user accountnet user "username" /active:yes |
Disable a user accountnet user "username" /active:no |