You may have seen our previous post about adding a local user to a machine during SCCM OSD using a “Run Command Line”. Well in this guide we will show you how to add a local user into the Administrators Group on the local machine. This means that you can add a local user and then make them a local administrator all within the SCCM OSD task sequence.
You will need to add a “Run Command Line” step towards the end of your task sequence ensuring it is after the Windows deployment and the ConfigMgr Client installation.
Then, you should use the following command:
cmd.exe /c net localgroup "Administrators" "LocalAdmin" /add
The details for what each part of this command line mean are below:
- cmd.exe /c – required to run a successful command
- net localgroup – command line to make amendments to local groups
- “Administrators” – the name of the local administrators group
- “LocalAdmin” – the name of your local user account
- /add – to add the stated user to the stated localgroup
When you have finished, your step should look something like this:
Now, when you run through your task sequence, this will run the command line and add your stated user to the local administrators group.
If you want to run this with also creating a new local user, ensure that you have this step after the create local user step or it will fail.
If you have any questions about this guide, please feel free to leave us a message below using our comments system.
Enter your email address below and click the Subscribe button to receive email notifications about new and exciting downloads available through our website at https://www.techygeekshome.com
You will also receive notifications about new technical guides, latest news and MSI installer downloads that are available through our blog here at https://blog.techygeekshome.info
We will not spam you and we will not pass on any of your details to anyone else. We tend to post new content once or twice a week.
You can unsubscribe any time you like.