{"id":5129,"date":"2012-08-13T11:59:00","date_gmt":"2012-08-13T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2012\/08\/13\/powertip-querying-active-directory-via-powershell\/"},"modified":"2012-08-13T11:59:00","modified_gmt":"2012-08-13T11:59:00","slug":"powertip-querying-active-directory-via-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-querying-active-directory-via-powershell\/","title":{"rendered":"PowerTip: Querying Active Directory via PowerShell"},"content":{"rendered":"<p><strong>Summary<\/strong>: Learn how to query Active Directory via Windows PowerShell.<\/p>\n<p><img decoding=\"async\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" \/>&nbsp;Can you name five ways to query Active Directory from within Windows PowerShell?<\/p>\n<p><img decoding=\"async\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" \/><\/p>\n<ol start=\"1\">\n<li>Use ADO and perform an LDAP dialect query.<\/li>\n<li>Use ADO and perform an SQL dialect query.<\/li>\n<li>Use the&nbsp;<b>Get-ADObject<\/b>&nbsp;cmdlet from the Active Directory module.<\/li>\n<li>Use DSQuery.<\/li>\n<li>Use the [ADSISearcher] type accelerator.<\/li>\n<\/ol>\n<div><span style=\"line-height: 0px\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2502.7331.Scripto.jpg-150x0.jpg\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2502.7331.Scripto.jpg-150x0.jpg\" border=\"0\" \/><\/a><br \/><\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to query Active Directory via Windows PowerShell. &nbsp;Can you name five ways to query Active Directory from within Windows PowerShell? Use ADO and perform an LDAP dialect query. Use ADO and perform an SQL dialect query. Use the&nbsp;Get-ADObject&nbsp;cmdlet from the Active Directory module. Use DSQuery. Use the [ADSISearcher] type accelerator.<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[356,3,45],"class_list":["post-5129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-powertip","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to query Active Directory via Windows PowerShell. &nbsp;Can you name five ways to query Active Directory from within Windows PowerShell? Use ADO and perform an LDAP dialect query. Use ADO and perform an SQL dialect query. Use the&nbsp;Get-ADObject&nbsp;cmdlet from the Active Directory module. Use DSQuery. Use the [ADSISearcher] type accelerator.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=5129"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5129\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=5129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=5129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=5129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}