user management
-
add a local user
net user username password /add
-
delete a local user
net user username /delete
-
add users from a .csv file
-
csv file content
username1,password1 username2,password2 username3,password3
-
batch
rem add users from a .csv file @echo off FOR /F "token=1,2 delims=," %%a IN (users.csv) DO net user %1 %1 /add rem delete .csv file del /F /Q users.csv
-
group management
-
add a local group
net localgroup groupname /Comment:"group comment" /add
-
delete a local group
net localgroup groupname /delete
-
add a user to a local group
net localgroup groupname username /add
-
delete a user form a local group
net localgroup groupname username /delete
managing a local administrator account in workgroup environments
@echo off
rem add the "ITAdmin" user
net user ITAdmin %1 /add
rem add the user to "administrators" group
net localgroup administrators ITAdmin /add
rem remove the user from the default "users" group
net localgroup users ITAdmin /delete