SCCM Add Local User: Creating One During OSD

Creating a local user account on a machine as part of an SCCM OSD task sequence is a common requirement — for a break-glass local admin, a support account, or similar — and it can be done with a single “Run Command Line” step, no extra scripting needed. Adding the step Add a Run Command […]

SCCM Add Local User During Osd
Creating a local user account on a machine as part of an SCCM OSD task sequence is a common requirement — for a break-glass local admin, a support account, or similar — and it can be done with a single “Run Command Line” step, no extra scripting needed.

Adding the step

Add a Run Command Line step towards the end of your task sequence, after the Windows deployment and ConfigMgr client install steps, with a meaningful name, and use:
cmd.exe /c net user LocalAdmin Pa55w0rd# /add /comment:"Local Admin Account" /expires:never /fullname:"Local Admin Account"
(Replace LocalAdmin and Pa55w0rd# with your own account name and a strong password specific to your environment — don’t deploy this example password as-is.)

Breaking the command down

  • cmd.exe /c — runs the command, required for a task sequence step to execute it correctly.
  • net user — the command that creates/manages local user accounts.
  • LocalAdmin — the account name to create.
  • Pa55w0rd# — the account’s initial password.
  • /add — creates the account.
  • /comment:"Local Admin Account" — a description shown against the account.
  • /expires:never — the account never expires (this does not affect password expiry, which is governed separately by local or domain password policy).
  • /fullname:"Local Admin Account" — the account’s display/full name.

Making it a local admin

This command creates a Standard user, not an administrator. If you also want the account added to the local Administrators group, add a second step afterwards using net localgroup — see our companion guide on adding a local user to the Administrators group during SCCM OSD for the exact syntax.

Resources

1

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.

6 thoughts on “SCCM Add Local User: Creating One During OSD

  1. I add this step and the other one to create a local account and add it to the administrator group. But, OSD fails with an 0x00000002 error code.

  2. Hi
    With this way you may have a security problem with the logs. The sccm logs will have the user and password in plain text, someone may found it and use account.
    You can delete the logs after the installation or use just use a package(powershell with secure string, c++ program etc…) that add the user, it may be decrypted also but is more difficult.

  3. I add this step and the other one to create a local account and add it to the administrator group. But, OSD fails with an 0x00000002 error code.

  4. Hi
    With this way you may have a security problem with the logs. The sccm logs will have the user and password in plain text, someone may found it and use account.
    You can delete the logs after the installation or use just use a package(powershell with secure string, c++ program etc…) that add the user, it may be decrypted also but is more difficult.

Comments are closed.