{"id":207,"date":"2018-02-20T12:11:54","date_gmt":"2018-02-20T12:11:54","guid":{"rendered":"https:\/\/www.tsfactory.com\/forums\/blogs\/?p=207"},"modified":"2021-09-23T06:32:01","modified_gmt":"2021-09-23T06:32:01","slug":"list-and-logging-off-user-sessions-in-windows","status":"publish","type":"post","link":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/","title":{"rendered":"List and Logging Off User Sessions in Windows"},"content":{"rendered":"<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">Recently I was playing around with Remote Sessions in VMware Horizon View and while trying to reboot a server, I was warned &#8220;there are users still logged on&#8221;, even though I was certain there were not. Well it turns out I was wrong. But who was still logged on?<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">Fortunately, there are a number of ways to solicit a user session list. One of the simplest ways is to use Windows\u00a0built-in DOS commands that allow you to list and logoff user sessions on any machine in your domain.<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">The DOS commands are <strong>QUSER<\/strong> and <strong>LOGOFF<\/strong> (quser is short for query user).<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\"><img decoding=\"async\" class=\"alignnone wp-image-27\" src=\"https:\/\/www.tsfactory.com\/forums\/everythingrdp\/wp-content\/uploads\/sites\/15\/2018\/09\/quser-300x28.jpg\" alt=\"\" width=\"879\" height=\"82\" \/><img decoding=\"async\" class=\"alignnone size-full wp-image-325\" src=\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/02\/quser-e1597825942257.png\" alt=\"\" width=\"678\" height=\"63\" \/><\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">These commands work on Windows 7 and higher, and Windows Server 2008 and higher.<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\"><strong>Notes:<\/strong><\/span><br \/>\n<span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">You need to have admin privileges in most cases to run these commands.<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">I found Windows 7 Pro required a registry edit to enable Remote RPC:\u00a0 \u00a0(No reboot required)<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">HKLM\\system\\currentcontrolset\\control\\terminal server\\AllowRemoteRPC = 1.<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">Another method is to use the Sysinternals Windows utilities. There is a tool named <strong>PSEXEC<\/strong> that can run commands on remote computers, making it possible to use QUSER to list user sessions remotely.<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-28\" src=\"https:\/\/www.tsfactory.com\/forums\/everythingrdp\/wp-content\/uploads\/sites\/15\/2018\/09\/psexec_quser-300x70.png\" alt=\"\" width=\"883\" height=\"206\" \/><img decoding=\"async\" class=\"alignnone wp-image-326 size-full\" src=\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/02\/psexec_quser-e1597825990126.png\" alt=\"\" width=\"639\" height=\"149\" \/><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">You can also use\u00a0PowerShell remoting, such as <strong>Invoke-Command<\/strong> or <strong>Enter-PSSession<\/strong>, to accomplish the same thing.<\/span><\/p>\n<p><span style=\"font-family: tahoma, arial, helvetica, sans-serif; font-size: 14pt;\">I am sure there are still other ways to accomplish these tasks, but these are fairly simple utilities that don&#8217;t require much investment in time to work with.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was playing around with Remote Sessions in VMware Horizon View and while trying to reboot a server, I was warned &#8220;there are users still logged on&#8221;, even though I was certain there were not. Well it turns out I was wrong. But who was still logged on? Fortunately, there are a number of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":209,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[29],"class_list":["post-207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-everythingrdp","tag-windows-machine"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>List and Logging Off User Sessions in Windows - Blogs<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"List and Logging Off User Sessions in Windows - Blogs\" \/>\n<meta property=\"og:description\" content=\"Recently I was playing around with Remote Sessions in VMware Horizon View and while trying to reboot a server, I was warned &#8220;there are users still logged on&#8221;, even though I was certain there were not. Well it turns out I was wrong. But who was still logged on? Fortunately, there are a number of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/\" \/>\n<meta property=\"og:site_name\" content=\"Blogs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TSFactoryLLC\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-20T12:11:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-23T06:32:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"532\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Thomas Kucmierz\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TSFactoryLLC\" \/>\n<meta name=\"twitter:site\" content=\"@TSFactoryLLC\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thomas Kucmierz\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/\",\"name\":\"List and Logging Off User Sessions in Windows - Blogs\",\"isPartOf\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg\",\"datePublished\":\"2018-02-20T12:11:54+00:00\",\"dateModified\":\"2021-09-23T06:32:01+00:00\",\"author\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg\",\"contentUrl\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg\",\"width\":800,\"height\":532},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"List and Logging Off User Sessions in Windows\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#website\",\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/\",\"name\":\"Blogs\",\"description\":\"TSFactory\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec\",\"name\":\"Thomas Kucmierz\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g\",\"caption\":\"Thomas Kucmierz\"},\"url\":\"https:\/\/www.tsfactory.com\/forums\/blogs\/author\/tom\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"List and Logging Off User Sessions in Windows - Blogs","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/","og_locale":"en_US","og_type":"article","og_title":"List and Logging Off User Sessions in Windows - Blogs","og_description":"Recently I was playing around with Remote Sessions in VMware Horizon View and while trying to reboot a server, I was warned &#8220;there are users still logged on&#8221;, even though I was certain there were not. Well it turns out I was wrong. But who was still logged on? Fortunately, there are a number of [&hellip;]","og_url":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/","og_site_name":"Blogs","article_publisher":"https:\/\/www.facebook.com\/TSFactoryLLC\/","article_published_time":"2018-02-20T12:11:54+00:00","article_modified_time":"2021-09-23T06:32:01+00:00","og_image":[{"width":800,"height":532,"url":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg","type":"image\/jpeg"}],"author":"Thomas Kucmierz","twitter_card":"summary_large_image","twitter_creator":"@TSFactoryLLC","twitter_site":"@TSFactoryLLC","twitter_misc":{"Written by":"Thomas Kucmierz","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/","name":"List and Logging Off User Sessions in Windows - Blogs","isPartOf":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage"},"image":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg","datePublished":"2018-02-20T12:11:54+00:00","dateModified":"2021-09-23T06:32:01+00:00","author":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec"},"breadcrumb":{"@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#primaryimage","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg","contentUrl":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-content\/uploads\/sites\/16\/2018\/09\/blog-blocks-wallpaper-1591056-e1632378715864.jpg","width":800,"height":532},{"@type":"BreadcrumbList","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/list-and-logging-off-user-sessions-in-windows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tsfactory.com\/forums\/blogs\/"},{"@type":"ListItem","position":2,"name":"List and Logging Off User Sessions in Windows"}]},{"@type":"WebSite","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#website","url":"https:\/\/www.tsfactory.com\/forums\/blogs\/","name":"Blogs","description":"TSFactory","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tsfactory.com\/forums\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/8e7f4d55c90bbfa9db13a8a349afcbec","name":"Thomas Kucmierz","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tsfactory.com\/forums\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/523758d74448ec724d30b7888a7707b22e7815470076d5913e0403095e38419e?s=96&d=mm&r=g","caption":"Thomas Kucmierz"},"url":"https:\/\/www.tsfactory.com\/forums\/blogs\/author\/tom\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":2,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":330,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/posts\/207\/revisions\/330"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/media\/209"}],"wp:attachment":[{"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tsfactory.com\/forums\/blogs\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}