{"id":342,"date":"2019-11-12T15:41:31","date_gmt":"2019-11-12T15:41:31","guid":{"rendered":"https:\/\/increasec.com\/?p=342"},"modified":"2021-02-28T23:45:17","modified_gmt":"2021-03-01T04:45:17","slug":"disable-old-accounts","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=342","title":{"rendered":"Disable Old Accounts"},"content":{"rendered":"\n<p>To reduce your attack surface it makes sense to disable unused accounts.  Here are some methods to figure out if an accout is unused.<\/p>\n\n\n\n<p>For a small number of users, Start a command prompt as administrator, doesn&#8217;t need to be on a domain controller.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">C:\\&gt;net user john \/domain | findstr \/C:\"Last logon\"\nLast logon                   9\/18\/2013 10:18:41 AM\n<\/pre>\n\n\n\n<p>To list all users to a .csv file that can be opened in Excel, use the following Powershell script.  Run powershell as administrator, be careful as notepad likes to add extra carriage returns.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Get-Aduser -Filter * -Properties *|select name,SamAccountName,PasswordExpired,PasswordLastSet,LastLogonDate,Enabled,DistinguishedName,DisplayName,GivenName,SurName|export-csv c:\\UsersLastLogon.csv\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To reduce your attack surface it makes sense to disable unused accounts. Here are some methods to figure out if an accout is unused. For a small number of users,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[51],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-domain"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342"}],"version-history":[{"count":2,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions"}],"predecessor-version":[{"id":1251,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions\/1251"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}