{"id":1924,"date":"2022-04-01T13:54:17","date_gmt":"2022-04-01T17:54:17","guid":{"rendered":"https:\/\/increasec.com\/?p=1924"},"modified":"2026-03-07T13:42:36","modified_gmt":"2026-03-07T18:42:36","slug":"active-directory-clear-admincount","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=1924","title":{"rendered":"Active Directory Clear AdminCount"},"content":{"rendered":"\n<p>PingCastle or another Domain health\/security tool may tell you that an account isn&#8217;t administrator but it has the adminCount set to a number larger than 0.   here is how to fix that.  Sometimes called AdminDsHolder<\/p>\n\n\n\n<p>Why do we care? this is to have a record of any process that sets itself to administrator, does it&#8217;s bad stuff, then removes administrator from itself.  BUT there is nothing stopping the process from resetting it&#8217;s own adminCount<\/p>\n\n\n\n<p>In the powershell snippet below userName is account name before @DomainName.  it won&#8217;t have any spaces.<\/p>\n\n\n\n<p>Get-ADUser userName | Set-ADObject -Clear adminCount<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PingCastle or another Domain health\/security tool may tell you that an account isn&#8217;t administrator but it has the adminCount set to a number larger than 0. here is how to&#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":[122],"class_list":["post-1924","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-ad"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1924","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=1924"}],"version-history":[{"count":4,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1924\/revisions"}],"predecessor-version":[{"id":4131,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/1924\/revisions\/4131"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}