Jump to content


  • 0

Question

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 .\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.

 

 

Cheers

 

 

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

  • 0

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

 

 

 

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.

Guest
Answer this question...

×   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.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.