Skip to content

Instantly share code, notes, and snippets.

@te-online
Created March 16, 2017 19:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save te-online/877858c398b752116ffcf0c56ddcaf61 to your computer and use it in GitHub Desktop.
Save te-online/877858c398b752116ffcf0c56ddcaf61 to your computer and use it in GitHub Desktop.
MDT Script Series: Create user accounts from powershell
net user "admin" "ADMINPASS" /add /fullname:"admin"
net localgroup "Administrators" "admin" /add
WMIC USERACCOUNT WHERE "Name='admin'" SET PasswordExpires=FALSE
net user "Student" "STUDENTPASS" /add /fullname:"Student's Account"
net localgroup "Users" "Student" /add
WMIC USERACCOUNT WHERE "Name='Student'" SET PasswordExpires=FALSE
WMIC USERACCOUNT WHERE "Name='Student'" SET Passwordchangeable=FALSE
net user "Teacher" "TEACHERPASS" /add /fullname:"Teacher's Account"
net localgroup "Users" "Teacher" /add
WMIC USERACCOUNT WHERE "Name='Teacher'" SET PasswordExpires=FALSE
WMIC USERACCOUNT WHERE "Name='Teacher'" SET Passwordchangeable=FALSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment