P3nnyw1se Posted February 21, 2014 Report post Posted February 21, 2014 during OSD from SCCM When creating a new machine I wanna create a local user called 'ITadmin' And add that to the Administrators group The following commands, I add as 'command lines' to my task sequence 1: net user /add ITadmin SecretCode1232: wmic useraccount where "Name='ITadmin'" set PasswordExpires=false these work, the ITadmin user is created and the password is set to never expire 3: net localgroup "Administratorer" "ITadmin" /add this third one does however not work. The group is called 'Administratorer' which is the danish version of 'Administrators' (I tried both) The line I pasted here works when I do it manually in an elevated cmd. it correctly adds ITadmin to the "Administratorer" group.So the command is correct So why doesn't it work during the task sequence? Could it be its because it requires Admin rights to do? how would I force it to attempt 'elevated' ? Quote Share this post Link to post Share on other sites More sharing options...
Yanze Posted September 24, 2015 Report post Posted September 24, 2015 I have exactly the same problem! The command works in an elevated prompt but doesn't inside a task sequence (it returns error code 0 though). Quote Share this post Link to post Share on other sites More sharing options...
Nyhuus Posted September 24, 2015 Report post Posted September 24, 2015 I have no solution to the code you wrote, but have you considered to give it a try using powershell insted?http://blogs.technet.com/b/heyscriptingguy/archive/2014/10/01/use-powershell-to-create-local-users.aspx http://serverfault.com/questions/120229/adding-a-user-to-the-local-administrator-group-using-powershell Quote Share this post Link to post Share on other sites More sharing options...
Lagamorph Posted September 28, 2015 Report post Posted September 28, 2015 You could try putting the commands into a notepad file and saving it as "Install.cmd", then turning that into a Package, with the folder containing Install.cmd as the source folder. Then create a Standard Program in that package, specifying Install.cmd as the command line, and you can then configure that the Program can run whether a user is logged on or not, which will also put the Run mode to "Run with administrative rights". Then just install the package as part of your task sequence at the point you were putting the command line entries. Quote Share this post Link to post Share on other sites More sharing options...