{"id":353,"date":"2011-06-25T09:05:43","date_gmt":"2011-06-25T08:05:43","guid":{"rendered":"http:\/\/www.nooblet.org\/blog\/?p=353"},"modified":"2013-09-09T06:53:09","modified_gmt":"2013-09-09T06:53:09","slug":"enable-or-disable-a-user-account-from-command-prompt","status":"publish","type":"post","link":"https:\/\/www.nooblet.org\/blog\/2011\/enable-or-disable-a-user-account-from-command-prompt\/","title":{"rendered":"Enable or Disable a user account from command prompt"},"content":{"rendered":"<p>In a domain environment you can enforce logon times for individual users, I wanted to emulate this behaviour in a workgroup.<\/p>\n<p>To do this first I learnt the following commands in command prompt [cmd] (run as Administrator):<\/p>\n<p>To disable: <code>net user Bob \/active:no<\/code><br \/>\nTo enable: <code>net user Bob \/active:yes<\/code><\/p>\n<p>I then created 2 tasks in Task Scheduler to disable and enable at the appropriate times.<\/p>\n<p>When creating the tasks its important to note:<\/p>\n<ul>\n<li>Run with highest privileges<\/li>\n<li>Run even when user not logged on<\/li>\n<li>The path to the &#8220;net&#8221; command is &#8220;C:\\Windows\\System32\\net.exe&#8221;<\/li>\n<li>The rest of the command line goes in the arguments box<\/li>\n<\/ul>\n<p>This helped to discourage my son from waking up at 4am to play Plants vs Zombies\u2122 on the computer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a domain environment you can enforce logon times for individual users, I wanted to emulate this behaviour in a workgroup. To do this first I learnt the following commands in command prompt [cmd] (run as Administrator): To disable: net user Bob \/active:no To enable: net user Bob \/active:yes I then created 2 tasks in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":641,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[100,165,234],"class_list":["post-353","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows","tag-logon","tag-user","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":2,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":942,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions\/942"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}