Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “Get AD Group members including Nested Members

  • Andreas Decker

    I’m new to PowerShell. I wondered why you don’t use the -recursive option allong with Get-ADGroupMember (e.g. Get-ADGroupMember – Identity “Khaleesi_Friends” -recursive) as your script also reports duplicates?

    I came allong your script because I am investigating a problem I ran into when using the the -recursive option and found it not working reliable in my environment. For some reason exactly 1 out of 287 user accounts is not reported from within a nested subgroup. If i run the Get-ADGroupMember directly on the subgroup the missing account is reported allong with the other acounts that where reported in my first try.

    When I run your script and eliminate the duplicates the missing account is reported.

    Any ideas why this one account is missing in the output when I use Get-ADGroupMembers allong with the -recursive option instead of your script?