How to find groups that belongs to a specific AD in Powershell

Lulzim Kamilji 0 Reputation points


I have now tried to search the entire internet for help with no luck.

I am trying to find the groups that belongs to a specific AD group we have through Powershell.

are you able to hook me up with a string to help me out?

Our AD name is: VRIT

i now want to show all groups that belongs to VRIT. we dont want the users, only GROUPS.!


L k.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,174 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 42,906 Reputation points

    Assuming you're looking only for groups that are direct members of the target group (and not members of groups that are direct member of the target group), this should get you started:

    Get-ADGroup groupx -property member |
            $x = Get-ADObject $_.distinguishedName
            if ($x.objectClass -eq 'group'){
    0 comments No comments

  2. Limitless Technology 43,231 Reputation points


    With this script you can get and export the group memberships to an AD Group:

    Get-ADGroupMember -Identity <groupname> | Select-Object name, objectClass,distinguishedName | Export-CSV -Path “adgroupmembers.csv”

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments