Shatners_wig Posted December 9, 2014 Report post Posted December 9, 2014 Hi All, We are currently using SCCM 2012 and are having problems getting the task sequence to create a local admin account. we used the below as a run command which doesn't work @echo off cls echo Creating Local Account: mccuser pushd %~dp0 echo. net user user PAssword /ADD /FULLNAME:"mccuser" /COMMENT:"Built in Local Admin Account" /ACTIVE:YES /PASSWORDCHG:NO /EXPIRES:NEVER net localgroup "Administrators" user /add wmic useraccount where "name='user'" set PasswordExpires=False popd We also created the below as a batch file and tried that in the task sequence as a application, again this does not work. cd\mkdir .\Usernet user User Password /ADDnet localgroup administrators %computername%\User /addrmdir .\User Both of the above work when run but not when part of a task sequence. Please can anybody tell us how you can get a command in the task sequence that will create a local admin account. Cheers Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted December 9, 2014 Report post Posted December 9, 2014 first, set a variable called TARGETUSER to be equal to the username you want ... then, as a run command line step, use the following, replace domain with your domain name cmd /c net localgroup "Administrators" "domain\%TARGETUSER%" /add Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted December 11, 2014 Report post Posted December 11, 2014 Be aware that the net.exe command only supports group names with a max string length of 20 chars. I would recommend to use a vbscript instead. http://support.microsoft.com/kb/324639/ Quote Share this post Link to post Share on other sites More sharing options...
Shatners_wig Posted December 11, 2014 Report post Posted December 11, 2014 Thanks all for your reply's - we have now got it working. Cheers Quote Share this post Link to post Share on other sites More sharing options...
melatocaroca Posted December 23, 2016 Report post Posted December 23, 2016 Thank you for your post and answer Requisites for Task sequence To be able to add a domain user to local administrators group, The task sequence command line to be executed must be added to one group, and this group must be placed and to the end of Windows deployment and the ConfigMgr Client installation and inside this group will put your required steps with the command to be executed Languages for TGT will be For English cmd /c net localgroup "Administrators" "YourDomainName\YourDomainAccountToAdd" /add For Spanish/Español cmd /c net localgroup "Administradores" "SuNombreDeDominio\NombreDeCuentaDeDominio-A-Ser-añadida" /add Localized Names for Administrator Account in Windows Cheers Quote Share this post Link to post Share on other sites More sharing options...