Creating admin users via batch
As we deploy machines and getting our master image perfect... Sysprep likes only one user for our custom "default profile" I'd like to add atleast 1 extra user to the machine after imaging using a batch file and creating the profile automatically(without logging in as that user). The idea is that once the new user profile has been created, we can push shortcuts and etc to it. Does that make sense?
So, here's where I'm stuck. Here's my batch file:
net user /add user1 password
net localgroup administrators user1 /add
net share concfg*C:\/grant:user1,full
*Insert create profile command*
Community Chosen Answer
I'm not sure why you are using sysprep unless this is either for Windows XP or a System Image. For Scripted Installations I would recommend using an unattend.xml generated by Windows System Image Manager. You can add multiple local admin accounts that way.
Change the lines:
strUser = inputbox("Enter the username for the new admin account.")
strPass = inputbox("Enter the password for the new account.")
strUser = "Username"
strPass = "Password"
Where "Username" is the Username and "Password" is the actual Password. (Yes I know that's obvious but...)
Name it adminuser.vbs and call it from a command line like:
You can upload the script as a Post-Installation Task on the K2000. No need for a "batch" file to run it then, but you can call the script from a batch.
To protect the user and password in the script, encrypt it with screnc.exe which you can find online. Make sure to rename it to .vbe though if you do.
Veritas Amor Pax