Link to home
Start Free TrialLog in
Avatar of Joe Howard
Joe HowardFlag for United States of America

asked on

Show hidden user account

Here's the situation:
I recently installed Windows 10 on a brand new machine, I created 4 users, the first one by default is the admin, the other ones are regular users.
Stupidly enough, I removed the password from the admin account, and disabled the admin account using the command line:
net user UserName /active:no

Open in new window

Obviously, I can no longer gain admin access to the machine. I can login to the regular users.
Is there any solution (vbs, or other) that will give me access to my admin account?

This code obviously will not run from a regular account (access denied):
Set objShell = CreateObject("Wscript.Shell") 
Set objNetwork = CreateObject("Wscript.Network") 
strComputer = objNetwork.ComputerName 
Set colAccounts = GetObject("WinNT://" & strComputer & "") 
colAccounts.Filter = Array("user") 
For Each objUser In colAccounts 
    If objUser.Name <> "Administrator" AND objUser.Name <> "ASPNET" Then 
            If objUser.AccountDisabled = TRUE then 
	   objUser.AccountDisabled = FALSE
                 objUser.SetInfo
            End if 
    End If 
Next 

Open in new window

I tried two other methods, but neither worked:
secpol.msc won't even open, I get an access denied error.
lusrmgr.msc opens but I get an access denied error trying to change the settings.
This is expected but I'm hoping there is  a workaround.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

net user administrator /active:yes
ASKER CERTIFIED SOLUTION
Avatar of Emmanuel Adebayo
Emmanuel Adebayo
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joe Howard

ASKER

@David
I get an access denied error. That command has to run from an elevated command prompt which I can't open as a limited account.

@Emmanuel
Your suggestion will reset the admin password, no? I don't think that will help, my admin privileged account (not the built in Administrator account) does not have a password.
No this will not reset the admin password. the twill enable the disable admin account. Check it properly.
RUNAS  requires a password
net user administrator Pa$$w0rd  will set the password
@David
net user administrator Pa$$w0rd will only work from an admin account.
Excellent!