Its sometimes necessary to create/add local users and add them to local groups, like administrators. Doing this as part of a Task Sequence, I find it’s easiest to use the NET command.
Here is the syntax for user=User01 with password=Password01 (Must run after “Setup Windows and ConfigMgr” Step)
Create user:
CMD.exe /c net user /add User01 Pssword01
Delete user:
CMD.exe /c net user /delete User01
Add user to the administrators group:
cmd.exe /c net localgroup /add administrators User01
Set Password to newer expires: (this can not be done using Net User)
cmd.exe /c WMIC USERACCOUNT WHERE “Name=’User01′” SET PasswordExpires=FALSE
This is helpful Michael, but how do you prevent the password from expiring?
Thanks!
Stephen
You can’t do this with Net User, but WMIC works like a charm for this.. I added the syntax to the post… be aware of the single quotations around the user name, the must be there ! ‘User01’
Hello,
Good find, I did have to use /y command for the add user otherwise the task sequence will hang when password is complex.
How can I set a blank password (NO PASSWORD)?