{"id":442,"date":"2014-11-16T17:00:21","date_gmt":"2014-11-16T22:00:21","guid":{"rendered":"http:\/\/adsecurity.org\/?p=442"},"modified":"2014-11-13T20:57:34","modified_gmt":"2014-11-14T01:57:34","slug":"powershell-find-all-users-in-active-directory-the-optimal-way","status":"publish","type":"post","link":"https:\/\/adsecurity.org\/?p=442","title":{"rendered":"PowerShell: Find All Users in Active Directory the Optimal Way"},"content":{"rendered":"<p>Today I Learned (TIL) that the best way to find all users in Active Directory via LDAP query is to search for: (samAccountType=805306368)<br \/>\nand NOT: (&amp;(objectClass=user)(<wbr \/>objectCategory=person))<\/p>\n<p>Reference: <a href=\"http:\/\/www.selfadsi.org\/extended-ad\/search-user-accounts.htm\" target=\"_blank\">http:\/\/www.selfadsi.org\/<wbr \/>extended-ad\/search-user-<wbr \/>accounts.htm<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I Learned (TIL) that the best way to find all users in Active Directory via LDAP query is to search for: (samAccountType=805306368) and NOT: (&amp;(objectClass=user)(objectCategory=person)) Reference: http:\/\/www.selfadsi.org\/extended-ad\/search-user-accounts.htm<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,2],"tags":[223,227,575],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-powershell","category-technical-reference","tag-adsi","tag-findalladusers","tag-powershell","item-wrap"],"_links":{"self":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=442"}],"version-history":[{"count":1,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":443,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/442\/revisions\/443"}],"wp:attachment":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}