Change logon command in Windows

  1. Applies to: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.

The change logon command enables or disables login from client sessions or displaying the current login status. This utility is very useful for system maintenance. To find examples of how to use this command, please go to the Example below.

Note

In Windows Server 2008 R2, Terminal Services has been renamed to Remote Desktop Services.

Command syntax change logon

 change logon {/ query | / enable | / disable | / drain | / drainuntilrestart} 

Parameters

Description / query parameter Displays the current login status, whether enabled or disabled. / enable Allow logging in from the guest session, but not from the control panel. / disable Disable subsequent logins from guest sessions, but not from the control panel. Does not affect the user currently logged in. / drain Disable login from the new guest session but allow connection to the current session. / drainuntilrestart The login information is disabled from the new guest sessions until the computer restarts, but allows connecting to existing sessions. /? Show help at the command prompt.

Note

  1. Only the administrator can use the change logon command.
  2. Logins are reactivated when you restart the system. If you are connected to the Remote Desktop Session Host (rd Session Host) server from the guest session and disable login, then log out before activating the login again, you will not be able to reconnect to your session. . To re-enable logins from client sessions, log in to the console.

For example

To display the current login status, enter:

 change logon / query 

To enable login from guest sessions, enter:

 change logon / enable 

To disable login from the client, enter:

 change logon / disable 

See more:

  1. Change command in Windows
  2. Cd command in Windows
  3. The cacls command in Windows
4 ★ | 53 Vote

May be interested

  • How to Change Directory in Command PromptHow to Change Directory in Command Prompt
    this article shows you how to change folders in the command prompt program on a windows computer. to change commands in command prompt, you must use an administrator account.
  • Instructions on how to change the alarm when Logoff, Logon and shutdown on Windows 10Instructions on how to change the alarm when Logoff, Logon and shutdown on Windows 10
    on previous versions of windows 10, users can easily change the alarm when booting, locking the device and turning off the computer on their windows computer. however, for some reason, microsoft has removed the ability to customize the start-up tone and lock on windows 10. however, you can 'bring back' this function on wndows 10 with just a few steps. here.
  • The bootcfg ems command in WindowsThe bootcfg ems command in Windows
    the bootcfg ems command allows users to add or change settings to redirect the emergency management services console to a remote computer.
  • How to Change Windows Logon ScreenHow to Change Windows Logon Screen
    this wikihow teaches you how to change the image that displays on the windows start-up screen. open the start menu. do this either by clicking the windows logo in the bottom-left corner of the screen, or by pressing your computer's key.
  • How to customize the Command Prompt on WindowsHow to customize the Command Prompt on Windows
    command prompt is a powerful tool that many people like to use. however, it looks a bit boring and unfriendly. fortunately, you can customize the command prompt according to your needs and preferences.
  • How to change the file's attributes using the Attrib commandHow to change the file's attributes using the Attrib command
    in windows, file attributes are settings associated with files on a computer that grant or deny certain rights to users or operating systems associated with accessing that file. the following article will show you how to change the properties of any file using attrib command in command prompt.
  • Basic Linux commands everyone needs to knowBasic Linux commands everyone needs to know
    when using linux, you should also learn basic linux commands to make operations quicker and easier. here are some basic commands on linux you should know.
  • Thread command in windowsThread command in windows
    the renaming command helps change file names or directories.
  • Command mode in WindowsCommand mode in Windows
    display system status, change system settings or reconfigure port and connected device.
  • Sub-commands in nslookup Windows command (Part 2)Sub-commands in nslookup Windows command (Part 2)
    nslookup set all command, nslookup set class, nslookup set d2, alias ​​nslookup set debug, nslookup set domain, nslookup set port, and nslookup set querytype in windows