We can manager user accounts on a Windows computer using wmic commands. You can find commands for various operations below.
List user accounts:
wmic useraccount get name
The above command will list the login names of all the users on the local computer. To print login name and full name we can
run the below command.
wmic useraccount get name,fullname
Lock user account:
wmic useraccount where name='username' set disabled=false
Unlock user account:
wmic useraccount where name='username' set disabled=true
Remove password requirement for logging in:
wmic useraccount where name='username' set PasswordRequired=false
Rename user account:
wmic useraccount where name='username' rename newname
Restrict user from changing password
wmic useraccount where name='username' set passwordchangeable=false
The above commands can be run on all Windows editions. On Vista and Windows 7, these commands should be run from elevated windows command prompt.