Отключить пользователя windows 10 cmd

on November 11, 2010

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.

Net user John /active:no

To re-enable the account :

Net user John /active:yes

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.

System error 5 has occurred.
Access is denied.

Using wmic to disable user account

Below wmic command works for disabling a user account

wmic useraccount where name='john' set disabled=true

For re-enabling user account

wmic useraccount where name='john' set disabled=false

If run from command prompt without elevated admin privileges it would result in the below error.

C:\>wmic useraccount where name='john' set disabled=false
Updating property(s) of '\\MYPC\ROOT\CIMV2:Win32_UserAccount.Domain="mypc",Name="guest"'
ERROR:
Description = Generic failure

Successful account updation would be like below.

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.

Related Posts:
Remove user from a group

If your PC is used by your family members, you may have multiple user accounts so that each person has his own account to manage their own files and applications separately. With the introduction of Windows 10, you can either create a local account or use a Microsoft account to sign in to Windows 10. But as the number of user account grows, you find it hard to manage them, and some of the accounts also become absolute, in this case, you might want to disable certain accounts. Or if you want to block the access of certain user then also you need to disable the user account to block the person from accessing your PC.

Enable or Disable User Accounts in Windows 10

Now in Windows 10, you have two options: to stop the user from accessing the account, either you could block the user account or disable his/her account. The only thing to note down here is that you must be signed in to your administrator account to follow this tutorial. So without wasting any time, let’s see how to Enable or Disable User Accounts in Windows 10 with the help of the below-listed guide.

Table of Contents

Make sure to create a restore point just in case something goes wrong.

Method 1: Enable or Disable User Accounts using Command Prompt

1. Open Command Prompt. The user can perform this step by searching for ‘cmd’ and then press Enter.

Open Command Prompt. The user can perform this step by searching for ‘cmd’ and then press Enter.

2. To Disable a User Account in Windows 10 type the following command into cmd and hit Enter:

Net user User_Name /active:no

Disable a User Account in Windows 10 | Enable or Disable User Accounts in Windows 10

Note: Replace User_Name with the account username you want to disable.

3. To Enable a User Account in Windows 10 type the following command into cmd and hit Enter:

Net user User_Name /active:yes

Note: Replace User_Name with the account username you want to enable.

4. Reboot your PC to save changes.

Method 2: Enable or Disable User Account using Group Policy Editor

1. Press Windows Key + R then type gpedit.msc and hit Enter.

gpedit.msc in run

2. Expand Local Users and Groups (Local) then select Users.

3. Now in the right window, pane double-click on the name of the user account you want to disable.

Right-click on the user account whose password expiration you want to enable then select Properties

4. Next, in the Properties window checkmarkAccount is disabled” to disable the user account.

Checkmark Account is disabled in order to disable the user account

5. Click Apply, followed by OK.

6. If you need to enable the user account in the future, go to the Properties window and uncheck Account is disabled” then click Apply followed by OK.

Uncheck Account is disabled in order to enable the user account | Enable or Disable User Accounts in Windows 10

7. Restart your PC to save changes.

Method 3: Enable or Disable User Account using Registry

1. Press Windows Key + R then type regedit and hit Enter to open Registry Editor.

2. Navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList

3. Right-click on UserList then selects New > DWORD (32-bit) Value.

Right-click on UserList then select New then click on DWORD (32-bit) Value

4. Type the name of the user account you want to disable for the name of the above DWORD and hit Enter.

Type the name of the user account you want to disable for the name of the above DWORD

5. To enable the user account to right-click on the above-created DWORD and select Delete.

6. Click Yes, to confirm and close the registry.

Click Yes in order to confirm

7.Reboot your PC to save changes.

Method 4: Enable or Disable User Account using PowerShell

1. Press Windows Key + Q to bring up Search, type PowerShell then right-click on PowerShell and select Run as Administrator.

In the Windows search type Powershell then right-click on Windows PowerShell (1)

2. To Disable a User Account in Windows 10 type the following command into PowerShell and hit Enter:

Disable-LocalUser -Name “User_Name”

Note: Replace User_Name with the account username you want to disable.

Disable the user account in PowerShell | Enable or Disable User Accounts in Windows 10

3. To Enable a User Account in Windows 10 type the following command into PowerShell and hit Enter:

Enable-LocalUser -Name “User_Name”

Note: Replace User_Name with the account username you want to enable.

Enable the user account using PowerShell | Enable or Disable User Accounts in Windows 10

4. Reboot your PC to save changes.

Recommended:

  • Enable or Disable Underline Access Key Shortcuts in Windows 10
  • Change Color of Start Menu, Taskbar, Action Center, and Title bar in Windows 10
  • Automatically Log in to User Account in Windows 10
  • Change Maximum and Minimum Password Age in Windows 10

That’s it you have successfully learned How to Enable or Disable User Accounts in Windows 10 but if you still have any queries regarding this article then feel free to ask them in the comment’s section.

Skip to content

How to Log Off Another User in Windows 10

Although the concept of multiple users sharing one device or one PC is getting rarer by the day, there are still cases when you have to share PCs and switch users fast. Sometimes you need to end a session for another user signed in to your computer. Here are a number of methods you can use.

The situation can be different when you need to end a user session. For example, someone just forgot to sign out from his or her user account, and left running apps and opened docs, so the remain in your computer’s memory and consume its system resources. In this case, it could be useful to kick out the inactive session for the other user.

There are no third party tools required. This can be done using either Task Manager, Command Prompt or PowerShell.

  1. Open the Task Manager app.
  2. If it looks as follows, switch it to the full view using the «More details» link in the bottom right corner.
  3. Click on the Users tab.
  4. Right-click on a user account you want to log off.
  5. Select Sign off from the context menu.
    Windows 10 Logoff Another User

You are done.

Alternatively, there are a couple of console tools we can use for the same purpose. Let’s review them.

Log Off Another User from the Command Prompt

  1. Open an elevated command prompt.
  2. Type or copy-paste the following command:query session. This will list available user sessions.
  3. Note the ID column value for the user you want to sign off.
    Windows 10 Logoff Another User With Cmd

  4. Now, execute the command logoff <ID>. For example, logoff 1.

You are done.

Finally, you can use PowerShell, as follows.

Log Off Another User from with PowerShell

  1. Open PowerShell as Administrator.Tip: You can add «Open PowerShell As Administrator» context menu.
  2. Type or copy-paste the following command:$sessionID = ((quser /server:'you computer name' | Where-Object { $_ -match 'user name to sign off' }) -split ' +')[2]
  3. Now, execute the command logoff $sessionID.
    Windows 10 Logoff Another User PowerShell

The PowerShell method is great when you know the exact user name. You can save it as a script and sign out other users with one click when needed.

That’s it.

Related blog posts:

  • Find the Sign Out Log in Windows 10
  • All ways to sign out from Windows 10

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won’t take a lot from you, but it will help us grow. Thanks for your support!

Quick Links

  • Windows 10 Home and Pro Users: Disable User Accounts with the Command Prompt

  • Windows 10 Pro Users Only: Disable a User Account with the Computer Management Tool

Windows lets you have multiple local users accounts on the same device. This lets every user have their own file storage, personalized desktop, and custom settings.

However, sometimes you need to disable a user’s account without deleting it because deleting the account would remove all their files, apps, and personalized settings. Disabling an account removes the account’s icon from the sign-in screen and from the menu to switch users. This lets you re-enable the account later on without losing any of their data. Here’s how you can enable or disable a user account in Windows 10.

Note: This article is intended mostly for people using Windows 10 in their homes or small businesses. If you’re using Windows 10 in a larger business, you likely won’t have multiple local user accounts set up on a system and these tools will probably be disabled anyway.

Windows 10 Home and Pro Users: Disable User Accounts with the Command Prompt

No matter which edition of Windows 10 you’re using (Home, Pro, or even Enterprise), you can use a quick command at the Command Prompt to enable or disable a local user account. While there is a graphical way to do this for Windows 10 Pro users (which we’ll cover in the next section), the Command Prompt is available to all and very quick.

First, open Command Prompt as an administrator. Hit Start, type “cmd” into the search box, and you’ll see “Command Prompt” listed as the main result. Right-click that result and choose “Run as administrator.”

At the prompt, type (or copy and paste) the following command, where <username> is the name of the user account you want to disable:

net user <username> /active:no
/wordpress/wp-content/uploads/2018/11/2018-11-21_10h54_16.png

After the command has completed, you can close Command Prompt. The user account will be disabled and will no longer show up as an active account for signing in. You can repeat the same process for any other accounts you want to disable.

Note: If you don’t know the exact name of the account, type in the command  net user to get a full list of all users.

/wordpress/wp-content/uploads/2018/11/2018-11-21_11h05_35.png

If you want to re-enable the account again all you have to do is open another elevated Command Prompt session, but this type «no» instead of «yes» for the active: switch. The command will look like this, again replacing <username> with the name of the user account you want to enable:

net user <username> /active:yes
/wordpress/wp-content/uploads/2018/11/2018-11-21_11h00_11.png

For this method, we’re going to be using the Computer Management Tool. It’s a quick and powerful way to access a myriad of administrative tools, like Task Scheduler, Performance Monitor, Device Manager, Disk Manager, and more. Windows 10 Pro and Enterprise users can use the Local Users and Groups section to grant and restrict a user’s access to your device. (Again, though, if you’re running Windows 10 Enterprise, you’re likely part of an Active Directory Domain and won’t have a use for, or access to, this tool.)

In Windows 10 Pro or Enterprise, open the Start Menu and search for «Computer Management.»

Alternatively, you can press Windows+X and then select «Computer Management» from the Power Users menu.

In the Computer Management window, navigate to System Tools > Local Users and Groups > Users. On the right, you’ll see a list of all the user accounts on your system.

/wordpress/wp-content/uploads/2018/11/2018-11-21_10h31_13.png

Right-click the user account you want to disable and then click «Properties.»

/wordpress/wp-content/uploads/2018/11/2018-11-21_10h31_15.png

In the Properties window that opens, select the «Account is Disabled» checkbox and then click «OK» to save the changes.

/wordpress/wp-content/uploads/2018/11/2018-11-21_10h37_40.png

Repeat the previous steps for any other user accounts you want to disable. Afterward, you can close Computer Management, and the disabled accounts will no longer show up on any sign-in screens.

To re-enable a user account, back to the Properties window for that account and cleat the «Account is Disabled» checkbox.

Windows 10 sign out other users options

(Image credit: Mauro Huculak)

On Windows 10, the ability for each user to have their own account is a convenient way to keep settings and files separate for a more personal experience. However, if someone doesn’t remember to sign out, their account will continue to run apps, services, and other processes, which can consume significant system resources and negatively affect the performance of the user actively using the device.

If you share a device with multiple people and someone forgets to log off, Windows 10 includes at least two ways to terminate the inactive session without leaving your account using Task Manager and Command Prompt.

In this how-to guide, I’ll explain how to log inactive users off your computer.

How to sign off other users from Task Manager

To sign off inactive users with Task Manager, use these steps:

  1. Open Start.
  2. Search for Task Manager and select the top result to open the tool.
  • Quick tip: You can also use the «Ctrl + Shift + Esc» keyboard shortcut to open Task Manager.
  1. Click the Users tab.
  2. Right-click the user and select the Sign off option.

Task Manager Sign off user option

(Image credit: Mauro Huculak)
  1. Click the «Sign out user» button.

Once you complete the steps, the user session will be terminated.

How to sign off other users from Command Prompt

To sign out other users with Command Prompt, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to view all current users signed in to Windows 10 and press Enter: query session
  4. Confirm the ID number for the account you want to sign off.
  5. Type the following command to sign out the other user and press Enter: logoff ID-NUMBER

In the command, remember to replace «ID-NUMBER» with the number of the account that you want to sign out. This example signs off the demo user account with the ID of 5: logoff 2

All the latest news, reviews, and guides for Windows and Xbox diehards.

Windows 10 Logoff Command

(Image credit: Mauro Huculak)

After you complete the steps, Windows 10 will sign out the user regardless if there is any running application.

More resources

For more in-depth insights, troubleshooting tips, and the latest updates on Windows 11 and 10, be sure to explore these resources:

  • Windows 11 on Windows Central — All you need to know
  • Windows 10 on Windows Central — All you need to know

Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Wps на ноутбуке windows 10
  • Programming windows чарльза петцольда
  • Иконки по середине панели задач windows 10
  • Как убрать невидимые папки в windows 10
  • Установка windows 10 с флешки не найден необходимый драйвер носителя