SCCM OSD Local User: Adding to the Administrators Group

If you need a local account created and added to the local Administrators group as part of an SCCM OSD task sequence, you can do this with a single “Run Command Line” step — no extra scripts or applications required. This is commonly used alongside a “create local user” step earlier in the task sequence, […]

Add Local User To Administrators Group During SCCM Osd
If you need a local account created and added to the local Administrators group as part of an SCCM OSD task sequence, you can do this with a single “Run Command Line” step — no extra scripts or applications required. This is commonly used alongside a “create local user” step earlier in the task sequence, so that a specific technician or service account ends up with local admin rights on every machine that gets imaged.

Adding the step

Add a Run Command Line step towards the end of your task sequence, after the Windows deployment and ConfigMgr client installation steps, and use the following command:
cmd.exe /c net localgroup "Administrators" "LocalAdmin" /add
Breaking the command down:
  • cmd.exe /c — runs the command and then exits, which is what a task sequence step expects.
  • net localgroup "Administrators" — targets the built-in local Administrators group (use the correct localized name if you’re deploying non-English builds).
  • "LocalAdmin" — the name of the local user account you want to add. Change this to match the account you created earlier in the sequence.
  • /add — adds the specified account to the group.

Order matters

If you also want to create the local user as part of the same task sequence, make sure the “create local user” step runs before this one — otherwise the account won’t exist yet and the step will fail. If you’re adding a domain account instead of a local one, use the same syntax but with DOMAINusername in place of the local account name. This approach works identically whether you’re deploying via ConfigMgr OSD on Windows 10 or Windows 11 — the underlying net localgroup command hasn’t changed.

Resources

SCCM Add Local Administrator

Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.

19 thoughts on “SCCM OSD Local User: Adding to the Administrators Group

  1. Good morning, First off I’d like to thank you this wonderful guide. I’ve integrated this into my SCCM a couple of different ways but am having issues. I first created two .bat files and add them into SCCM as packages. I did individual ones and one that has both commands added and causes the user script to run first so the account is created and then the admin script runs to give the created user admin rights. I have successfully run these.bat files on machines and they work flawlessly. I’ve tried both these scenarios in SCCM during OSD. When I use the individual .bat packages, the user profile gets created but it doesn’t get admin rights. When I use the combo ( both command lines run back to back ) it doesn’t even create the user. Lastly, I tried just adding the cmd lines into the task sequence. Again, the user gets created but its not getting the admin rights. Any thoughts would be appreciated. Thanks and have a great day.

  2. 0x00000002 – add your task most latest, after “Setup Windows and Configuration Manager”

  3. Hello,

    I’m trying to create a user and adding it to administrator group during OSD but it fails with an 0x00000002 error code.

    can u help me plz ?

  4. Hi,

    How can I add an AD security Group into local administrator group as part of OSD task sequence using SCCM 2012 R2?

    Please help..

    thanks

  5. How can i set the local user just created as a autologon user? (as part of OSD task sequence using SCCM 2012 R2)

  6. I do the second task of add as administrator and I get an error.

    Error – Event ID – 10016

  7. 0x00000002 – add your task most latest, after “Setup Windows and Configuration Manager”

  8. I do the second task of add as administrator and I get an error.

    Error – Event ID – 10016

  9. How can i set the local user just created as a autologon user? (as part of OSD task sequence using SCCM 2012 R2)

  10. Hello,

    I’m trying to create a user and adding it to administrator group during OSD but it fails with an 0x00000002 error code.

    can u help me plz ?

  11. Hi,

    How can I add an AD security Group into local administrator group as part of OSD task sequence using SCCM 2012 R2?

    Please help..

    thanks

Comments are closed.