How To Logoff From Command Line In Windows? – POFTUT

How To Logoff From Command Line In Windows?

Windows operating system is GUI based but provides some commands for administrative jobs. logoff command is one of them and used with the command line. The logoff command has very few options and features. We will look at these usage types of logoff command below.

logoff Command Help

Help about logoff command can be listed with /? option like below.

$ logoff /?

Logoff Command Usage

We can use logoff command without providing any option or parameter. This will logoff current session.

$ logoff

Logoff With Session ID or Name

On a computer, there may be more than one session. One of the sessions can be specified to log off. How can we specify the session name? Like below. In this example, we specify session-id 2 to log off.

$ logoff 2

Print Actions While Logoff

Verbose information about the logoff action can be printed with the /v option.

$ logoff /V

Logoff Session In the Remote Computer

Another useful feature of the logoff command is logoff remote system. We will provide the remote system IP address or domain name after the command like below.

$ logoff \\myserver

LEARN MORE  Run Commands In Local and Remote System With Powershell Invoke-Command Cmdlet

Leave a Comment