Enable or Disable User Account From Command Line
Enable or Disable User Account From Command Line
To disable a user from logging into system, we can disable the account by opening computer
management console and double clicking on the entry for the user and then by selecting the
check button “Account is disabled”
We can do the same by just running a simple command from windows command line.
For example, to disable a user account named John we can run the below command.
In Windows 7, you need to run the above commands from elevated administrator command
prompt(See How to open elevated command prompt in Windows 7 ). You would get the below
error when you run them from normal command prompt.
If run from command prompt without elevated admin privileges it would result in the below
error.
1
C:\>wmic useraccount where name='john' set disabled=false
Updating property(s) of
'\\MYPC\ROOT\CIMV2:Win32_UserAccount.Domain="MYPC",Name="john"'
Property(s) update successful.