{"id":2866,"date":"2015-07-08T23:26:20","date_gmt":"2015-07-08T21:26:20","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=2866"},"modified":"2015-07-09T13:55:33","modified_gmt":"2015-07-09T11:55:33","slug":"windows-automatically-logout-a-user-on-inactive","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/windows-automatically-logout-a-user-on-inactive\/","title":{"rendered":"Windows: Automatically logout a User on inactive"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_2866 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_2866')){$('.twoclick_social_bookmarks_post_2866').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Windows%3A%20Automatically%20logout%20a%20User%20on%20inactive\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0AWindows%20has%20no%20Group%20policy%20or%20setting%20to%20logout%2Flogoff%20a%20User%20if%20its%20inactive.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/windows-automatically-logout-a-user-on-inactive\\\/\",\"post_id\":2866,\"post_title_referrer_track\":\"Windows%3A+Automatically+logout+a+User+on+inactive\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>Windows has no Group policy or setting to logout\/logoff a User if its inactive.<br \/>\n<!--more--><\/p>\n<p>My solution is to define a Schedule Task to log the User out on idle.<\/p>\n<p>Start the Task Scheduler and create a new Task. In the Security Groupbox choose all user which should affected by the task. in my example all Users of the BUILTIN\\Users Group.<\/p>\n<figure id=\"attachment_2869\" aria-describedby=\"caption-attachment-2869\" style=\"width: 600px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-General.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2869\" src=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-General.png\" alt=\"Create Task General Tab\" width=\"600\" height=\"451\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-General.png 648w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-General-300x225.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2869\" class=\"wp-caption-text\">Create Task General Tab<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Set the trigger to &#8220;on idle&#8221;<\/p>\n<figure id=\"attachment_2870\" aria-describedby=\"caption-attachment-2870\" style=\"width: 600px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Triggerl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2870\" src=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Triggerl.png\" alt=\"Create Task Trigger Tab\" width=\"600\" height=\"516\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Triggerl.png 606w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Triggerl-300x258.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2870\" class=\"wp-caption-text\">Create Task Trigger Tab<\/figcaption><\/figure>\n<p>Action is to execute &#8220;C:\\windows\\system32\\logoff.exe&#8221;<\/p>\n<figure id=\"attachment_2871\" aria-describedby=\"caption-attachment-2871\" style=\"width: 469px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Action.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2871\" src=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Action.png\" alt=\"Create Task Action Tab\" width=\"469\" height=\"507\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Action.png 469w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Action-278x300.png 278w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><figcaption id=\"caption-attachment-2871\" class=\"wp-caption-text\">Create Task Action Tab<\/figcaption><\/figure>\n<p>And as condition the idle time, here 30 Minutes<\/p>\n<figure id=\"attachment_2872\" aria-describedby=\"caption-attachment-2872\" style=\"width: 600px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Condition.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2872\" src=\"http:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Condition.png\" alt=\"Create Task Action Tab\" width=\"600\" height=\"450\" srcset=\"https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Condition.png 645w, https:\/\/michlstechblog.info\/blog\/wp-content\/uploads\/2015\/07\/Create-Task-Condition-300x225.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-2872\" class=\"wp-caption-text\">Create Task Action Tab<\/figcaption><\/figure>\n<p>Here is the Task exported as XML file<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;\r\n&lt;Task version=&quot;1.2&quot; xmlns=&quot;http:\/\/schemas.microsoft.com\/windows\/2004\/02\/mit\/task&quot;&gt;\r\n  &lt;Triggers&gt;\r\n    &lt;IdleTrigger&gt;\r\n      &lt;Enabled&gt;true&lt;\/Enabled&gt;\r\n    &lt;\/IdleTrigger&gt;\r\n  &lt;\/Triggers&gt;\r\n  &lt;Principals&gt;\r\n    &lt;Principal id=&quot;Author&quot;&gt;\r\n      &lt;GroupId&gt;S-1-5-32-545&lt;\/GroupId&gt;\r\n      &lt;RunLevel&gt;LeastPrivilege&lt;\/RunLevel&gt;\r\n    &lt;\/Principal&gt;\r\n  &lt;\/Principals&gt;\r\n  &lt;Settings&gt;\r\n    &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;\/MultipleInstancesPolicy&gt;\r\n    &lt;DisallowStartIfOnBatteries&gt;false&lt;\/DisallowStartIfOnBatteries&gt;\r\n    &lt;StopIfGoingOnBatteries&gt;true&lt;\/StopIfGoingOnBatteries&gt;\r\n    &lt;AllowHardTerminate&gt;true&lt;\/AllowHardTerminate&gt;\r\n    &lt;StartWhenAvailable&gt;false&lt;\/StartWhenAvailable&gt;\r\n    &lt;RunOnlyIfNetworkAvailable&gt;false&lt;\/RunOnlyIfNetworkAvailable&gt;\r\n    &lt;IdleSettings&gt;\r\n      &lt;Duration&gt;PT30M&lt;\/Duration&gt;\r\n      &lt;WaitTimeout&gt;PT1H&lt;\/WaitTimeout&gt;\r\n      &lt;StopOnIdleEnd&gt;true&lt;\/StopOnIdleEnd&gt;\r\n      &lt;RestartOnIdle&gt;true&lt;\/RestartOnIdle&gt;\r\n    &lt;\/IdleSettings&gt;\r\n    &lt;AllowStartOnDemand&gt;true&lt;\/AllowStartOnDemand&gt;\r\n    &lt;Enabled&gt;true&lt;\/Enabled&gt;\r\n    &lt;Hidden&gt;false&lt;\/Hidden&gt;\r\n    &lt;RunOnlyIfIdle&gt;true&lt;\/RunOnlyIfIdle&gt;\r\n    &lt;WakeToRun&gt;false&lt;\/WakeToRun&gt;\r\n    &lt;ExecutionTimeLimit&gt;P3D&lt;\/ExecutionTimeLimit&gt;\r\n    &lt;Priority&gt;7&lt;\/Priority&gt;\r\n  &lt;\/Settings&gt;\r\n  &lt;Actions Context=&quot;Author&quot;&gt;\r\n    &lt;Exec&gt;\r\n      &lt;Command&gt;C:\\windows\\system32\\logoff.exe&lt;\/Command&gt;\r\n    &lt;\/Exec&gt;\r\n  &lt;\/Actions&gt;\r\n&lt;\/Task&gt;\r\n<\/pre>\n<p>Save it and import the task<br \/>\n<code><br \/>\nc:\\> SCHTASKS \/Create \/TN \"Autologout\" \/XML \"C:\\temp\\Autologout.xml\"<br \/>\n<\/code><\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, Windows has no Group policy or setting to logout\/logoff a User if its inactive.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[701,705,704,703,702,20],"class_list":["post-2866","post","type-post","status-publish","format-standard","hentry","category-windowsknowhow","tag-auto","tag-idle","tag-inactive","tag-logoff-user","tag-logout-user","tag-windows-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=2866"}],"version-history":[{"count":6,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2866\/revisions"}],"predecessor-version":[{"id":2874,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/2866\/revisions\/2874"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=2866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=2866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=2866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}