{"id":623,"date":"2016-05-17T18:55:49","date_gmt":"2016-05-17T07:55:49","guid":{"rendered":"https:\/\/4it.com.au\/kb\/?post_type=article&#038;p=623"},"modified":"2016-05-17T19:12:38","modified_gmt":"2016-05-17T08:12:38","slug":"log-off-user-command-line-windows-remotely","status":"publish","type":"article","link":"https:\/\/4it.com.au\/kb\/article\/log-off-user-command-line-windows-remotely\/","title":{"rendered":"How To Log Off A User From The Command Line in Windows Remotely"},"content":{"rendered":"<p>There are multiple ways to log off the current user on a Windows system using the command line. \u00a0The version of the commands below will depend on the Windows version, the interface you are using to log off the user (e.g. Remote Command Prompt, RMM, Local Command Prompt) etc..<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The command to force the current user to log off \u00a0immediately using the command line in Windows is:<\/strong><\/p>\n<p><code>shutdown \/l \/f \/t 00<\/code><\/p>\n<p>Sometimes you will need to use a &#8220;-&#8221; instead of a &#8220;\/&#8221;<\/p>\n<p><code>shutdown -l -f -t 00<\/code><\/p>\n<p><strong>If you&#8217;d like to log off the session giving the current user the chance to save any work you would just exclude the &#8220;\/f&#8221;<\/strong><\/p>\n<p><code>shutdown \/l<\/code><\/p>\n<p>or<\/p>\n<p><code>shutdown -l<\/code><\/p>\n<h3>On some remote management systems you can&#8217;t issue the shutdown command. \u00a0In these cases what you need to do is find out the current user&#8217;s active session number by issuing the following command:<\/h3>\n<p><code>query user<\/code><\/p>\n<p><a href=\"https:\/\/4it.com.au\/kb\/wp-content\/uploads\/2016\/05\/Query-User.png\"><img class=\"alignnone size-full wp-image-625\" data-original=\"https:\/\/4it.com.au\/kb\/wp-content\/uploads\/2016\/05\/Query-User.png\" alt=\"Query User\" width=\"597\" height=\"73\" \/><\/a><\/p>\n<p>You will then be able to see the current user&#8217;s Id and issue the logoff command instead:<\/p>\n<p><code>logoff <strong>1<\/strong><\/code><\/p>\n<p>Where 1 is the ID of the user you are logging off after performing the query user command.<\/p>\n<p><em>The following command has been tested on Windows XP, Windows 7, Windows 8, Windows 8.1, Windows 10. \u00a0Your mileage may vary on other version of windows.<\/em><\/p>\n<div style='text-align:left' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>There are multiple ways to log off the current user on a Windows system using the command line. \u00a0The version of the commands below will depend on the Windows version, the interface you are using to log off the user (e.g. Remote Command Prompt, RMM, Local Command Prompt) etc.. &nbsp; The command to force the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","article-category":[9],"article-tag":[493,494],"class_list":["post-623","article","type-article","status-publish","format-standard","hentry","article-category-windows-commands","article-tag-force-log-off-command-line","article-tag-force-log-off-user-command-prompt"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":18,"sum_votes":76},"_links":{"self":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":0,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article\/623\/revisions"}],"wp:attachment":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article-category?post=623"},{"taxonomy":"article-tag","embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article-tag?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}