Jump to content

Recommended Posts

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.


mkdir .\User
net user User Password /ADD
net localgroup administrators %computername%\User /add
rmdir .\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.







Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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






Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...