Managing user accounts is a common task that is often performed by IT professionals for a variety of purposes such as creating new accounts, resetting passwords, and modifying user permissions. In this blog, we will show you some of the commands you can use to manage user accounts using PowerShell and the Command Prompt in Windows.
To create a new user account using PowerShell, use the following command:
New-LocalUser -Name "UserName" -Password (Read-Host -AsSecureString "Enter Password")
Replace “UserName” with the desired username, and enter the password when prompted. This will create a new local user account with the specified username and password.
To change the password of a user account using PowerShell, use the following command:
Set-LocalUser -Name "UserName" -Password (Read-Host -AsSecureString "Enter Password")
Replace “UserName” with the username of the account you want to change the password for, and enter the new password when prompted.
To delete a user account using PowerShell, use the following command:
Remove-LocalUser -Name "UserName"
Replace “UserName” with the username of the account you want to delete.
To create a new user account using the Command Prompt, use the following command:
net user username password /add
Replace “username” and “password” with the desired values for the username and password of the user account.
To change the password of a user account using the Command Prompt, use the following command:
net user username password
Replace “username” and “password” with the desired values for the username and new password of the user account.
To delete a user account using the Command Prompt, use the following command:
net user username /delete
Replace “username” with the username of the account you want to delete.