1.    14 May 2016 #1
    Join Date : Nov 2015
    Posts : 108
    Win 10

    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.    14 May 2016 #2
    Join Date : Oct 2013
    A Finnish expat in Germany
    Posts : 13,114
    Windows 10 Pro

    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
    Join Date : Nov 2015
    Posts : 108
    Win 10
    Thread Starter

    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.    14 May 2016 #4
    Join Date : Oct 2013
    A Finnish expat in Germany
    Posts : 13,114
    Windows 10 Pro

    Quote Originally Posted by questorfla 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

 


Similar Threads
Thread Forum
Solved Hidden Administrator Cannot See My Main Local Account
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....
User Accounts and Family Safety
Solved Logging in with Microsoft account rather than local administrator acco
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...
User Accounts and Family Safety
Windows 10 deleted my local administrator account
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...
User Accounts and Family Safety
Solved How to revert local account to administrator acc.
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,
User Accounts and Family Safety
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 23:51.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums