To list all members of one AD security group: Get-AdGroupMember -identity "Domain Admins" | get-aduser -Properties * | ft name, samaccountname, whencreated To list all sec. groups of one AD user (member of what groups): Get-ADUser -Identity [someone'-samaccountname] -Properties memberof|Select-Object -ExpandProperty memberof To copy all groups from one AD user to other: Get-ADUser -Identity [source-user-samaccountname] -Properties memberof|Select-Object -ExpandProperty memberof|Add-ADGroupMember -Members [target-user-samaccountname] # all groups of [source-user-samaccountname] will be copied to [target-user-samaccountname]{"id":1613,"date":"2021-04-30T08:46:42","date_gmt":"2021-04-30T00:46:42","guid":{"rendered":"https:\/\/www.itforce.mn\/?p=1613"},"modified":"2021-04-30T10:10:42","modified_gmt":"2021-04-30T02:10:42","slug":"how-to-get-list-of-all-ad-users-in-ad-group","status":"publish","type":"post","link":"https:\/\/www.itforce.mn\/index.php\/2021\/04\/30\/how-to-get-list-of-all-ad-users-in-ad-group\/","title":{"rendered":"How to get list of all AD users in AD group"},"content":{"rendered":"<p>To list all members of one AD security group:<\/p>\n<pre>\r\nGet-AdGroupMember -identity \"Domain Admins\" | get-aduser -Properties * | ft name, samaccountname, whencreated\r\n<\/pre>\n<p>To list all sec. groups of one AD user (member of what groups):<\/p>\n<pre>\r\nGet-ADUser -Identity [someone'-samaccountname] -Properties memberof|Select-Object -ExpandProperty memberof\r\n<\/pre>\n<p>To copy all groups from one AD user to other:<\/p>\n<pre>\r\nGet-ADUser -Identity [source-user-samaccountname] -Properties memberof|Select-Object -ExpandProperty memberof|Add-ADGroupMember -Members [target-user-samaccountname]\r\n<\/pre>\n<p># all groups of [source-user-samaccountname] will be copied to [target-user-samaccountname]<\/p>\n","protected":false},"excerpt":{"rendered":null,"protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,17],"tags":[],"class_list":["post-1613","post","type-post","status-publish","format-standard","hentry","category-active-directory","category-powershell-tips"],"_links":{"self":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/comments?post=1613"}],"version-history":[{"count":6,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1613\/revisions"}],"predecessor-version":[{"id":1625,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/posts\/1613\/revisions\/1625"}],"wp:attachment":[{"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/media?parent=1613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/categories?post=1613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itforce.mn\/index.php\/wp-json\/wp\/v2\/tags?post=1613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}