Windows 10: Script to create a local account with administrator privileges Solved

  1.    14 May 2016 #1

    Script to create a local account with administrator privileges


    Is there a script using 'net user' or similar to create a local administrator account including password for Windows 10? I tried to put something together but apparently missed a step or have one out of order.

    The purpose is to give Users a way to create a 'backup' account to be used if they forget their password or any number of other problems that can prevent them from logging into their system; with their normal Microsoft Account.
    Rather than walk them through each step over the phone, I could email them a script to be run before the problems happen It would create a local admin account with a specific password that could be used in emergencies.

    This is for employees who have company systems but are seldom at the office and I would want to preload the name and password so they would not accidentally connect with it but it would be there and ready to use if they call for help.
    Can this still be done in Windows 10 if all the steps are in the right place?
      My ComputerSystem Spec


  2. Posts : 11,220
    Windows 10 Pro
       14 May 2016 #2

    A simple two line batch file does what you want to:

    Code:
    net user USERNAME PASSWORD /add
    net localgroup Administrators USERNAME /add

    Notice that the batch needs to be run elevated. Tutorials:


    Kari
      My ComputerSystem Spec

  3.    14 May 2016 #3

    Thanks! I see where i was losing my way now. Trying TOO hard.
    I was trying to get it all to run in one line and it kept failing. Two lines, no problems.
      My ComputerSystem Spec


  4. Posts : 11,220
    Windows 10 Pro
       14 May 2016 #4

    questorfla said: View Post
    I was trying to get it all to run in one line and it kept failing. Two lines, no problems.
    Exactly. The account needs to be created first (line 1) before it can be added to Administrators group (line 2).
      My ComputerSystem Spec


 

Related Threads
Solved Hidden Administrator Cannot See My Main Local Account in User Accounts and Family Safety
For one reason or another I managed to delete administrator privileges for my one local account. After several hours messing about I have managed to activate the hidden Administrator - but I am finding that this Administrator is not helping. 1....
I would like to use some of the features that require you to log in with a Microsoft account rather than my own local administrator account. But when I did that, it totally changed my settings for my local account including desktop, etc. So I...
Windows 10 deleted my local administrator account in User Accounts and Family Safety
I run a pretty simple setup at home so the family don't have to call the IT Guy everytime the computer beeps. I have a computer name 'COMPUTER', I have a local computer account 'COMPUTER' and the account has a password 'COMPUTER'. Pretty simple and...
Solved How to revert local account to administrator acc. in User Accounts and Family Safety
I changed my local administrator account, to standard accc., now I lost all elevated rights. I have a working windows account, but I don't know the password of the local account to revert. Thanks,
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 18:42.
Find Us