Saturday, October 8, 2011

Create new user account from command line in windows 2000, windows XP and windows 7

Some times we want to add new users from command line instead of using the GUI. Windows provides net user command for this purpose.

To add a new user account to the local computer from command line:

net user username userpassword /ADD /DOMAIN

Few more Advanced uses of net use command. 

To specify user full name while creating the user account

net user username userpasswd /ADD /FULLNAME:"User_Fullname"

To specify that the user is allowed to change the password:

net user username userpasswd /ADD /PASSWORDCHG:Yes

Add a user to administrators group from command line.

net localgroup group_name username /add

To add a domain user to local users group from command line:

net localgroup users domainname\username /add

To delete a user

net user username /DELETE

or
net user username /DELETE /DOMAIN


No comments:

Post a Comment