1

I would like to find an AD group user's group's that their in and to find what those different group's notes are.

Right now, I'm trying this

Get-ADPrincipalGroupMembership "username" | Get-ADUser -Properties info,description

Which is giving errors. I know there must be an easy way to do this that I'm missing.

Michael
  • 103
  • 11
  • It's not clear enough what you're looking for, `Get-ADPrincipalGroupMembership` returns the group's a user is __member of__ (cannot be piped to `Get-ADUser`), on the other hand, on the title you mention `Get-ADGroupMember` which you're not using on your code. – Santiago Squarzon Feb 04 '22 at 22:35
  • I want to get AD group members (not the command). For example, I want to get everything in the user's Member Of tab and then for it to display the notes section of each group listed in that user's Member Of tab – Michael Feb 05 '22 at 01:01

1 Answers1

0

I believe this is what you're looking for, query the user's MemberOf attribute and for each group, query the group's Info and Description attributes (I've also added Name so you have that reference which I believe is important to have):

(Get-ADUser "username" -Properties MemberOf).MemberOf |
Get-ADGroup -Properties Name, Info, Description |
Select-Object Name, Info, Description
Santiago Squarzon
  • 41,465
  • 5
  • 14
  • 37