{"id":1884,"date":"2019-12-08T07:26:08","date_gmt":"2019-12-08T07:26:08","guid":{"rendered":"https:\/\/andy.teknostatik.co.uk\/kb\/?p=1884"},"modified":"2019-12-08T07:26:08","modified_gmt":"2019-12-08T07:26:08","slug":"querying-active-directory-with-powershell","status":"publish","type":"post","link":"https:\/\/andy.teknostatik.co.uk\/kb\/2019\/12\/08\/querying-active-directory-with-powershell\/","title":{"rendered":"Querying Active Directory with Powershell"},"content":{"rendered":"\n<p> View members in a group:<\/p>\n\n\n\n<p><code>Get-ADGroupMember -identity <em>groupname<\/em> | sort name | select-object -expand Name<\/code><\/p>\n\n\n\n<p><br>Same as above, but does a recursive search through all sub-groups:<\/p>\n\n\n\n<p><code>Get-ADGroupMember -identity <em>groupname<\/em> -Recursive | sort name | select-object -expand Name<\/code><\/p>\n\n\n\n<p><br>View groups a single person is in:<\/p>\n\n\n\n<p><code>Get-ADPrincipalGroupMembership <em>username<\/em> | select name,distinguishedName | sort distinguishedName <\/code><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>View members in a group: Get-ADGroupMember -identity groupname | sort name | select-object -expand Name Same as above, but does a recursive search through all sub-groups: Get-ADGroupMember -identity groupname -Recursive | sort name | select-object -expand Name View groups a single person is in: Get-ADPrincipalGroupMembership username | select name,distinguishedName | sort distinguishedName<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","_share_on_mastodon":"0"},"categories":[10],"tags":[],"class_list":["post-1884","post","type-post","status-publish","format-standard","hentry","category-windows"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts\/1884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/comments?post=1884"}],"version-history":[{"count":2,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts\/1884\/revisions"}],"predecessor-version":[{"id":1886,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/posts\/1884\/revisions\/1886"}],"wp:attachment":[{"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/media?parent=1884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/categories?post=1884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andy.teknostatik.co.uk\/kb\/wp-json\/wp\/v2\/tags?post=1884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}