HOWTO: Disable an account on the command line

If you have an unnecessary account on your computer, you can delete or disable it. If you delete it - then all data from it will be lost and it can not be restored. If you disable an account, you can enable it in the future without losing any data. A disabled account disappears from the login screen and from switching to the Start menu. In today's article we will look how to disable an account in Windows 10. To disable user accounts, the user under which you are logged in must have administrator rights.

1. Open a command prompt:

   - Open a command prompt on behalf of the administrator: one of the ways is to right-click on the "Start" menu and select "Command Prompt (Administrator)" from the menu that opens.

Open a command prompt

2. Disable the local account:

   - To disable the local account, enter the command Net user "account name" / active: no replacing the highlighted red with your own and press the Enter key. For example, we need to disable the Sa account - the command for input will look like this: Net user "Sa" / active: no
If you need to disable a domain account you need to use the command Net user "username" / active: no / domain
After the caption "Command completed successfully" you can close the command line.

Disable the local account

Also consider using Action1 to disable the local account if:
- You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
- Some of your endpoints are laptops not connected to corporate network at all times.

Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.

Other Relevant HOWTOs: