get AD group path in the domain/tree

22,787

2 ways so far:

  • canonical name:

get-adgroup -identity "your group" -properties canonicalname | sel -property canonicalname [enter]

canonicalname

Your.Domain/ou name/ou name/your group

  • using the distinguishedname:

    $group = get-adgroup identity "your group" [enter]

    ($group.DistinguishedName -split"," ,2)[1] [enter] ou=name,ou,name,dc=your,dc=domain,dc=tld

sorry, I do not seem to get the right formatting, but you get the picture.

Share:
22,787

Related videos on Youtube

florian.isopp
Author by

florian.isopp

Updated on September 18, 2022

Comments

  • florian.isopp
    florian.isopp over 1 year

    How to get the path of a specific group from the Domain/tree? I am not getting to the info with the "Active Directory Users and Groups" program.

    We have a extensive tree of folders beneath the company.com domain. And I want to know where a specific group "AXX G Doc Users" resides. I'm experimenting with PowerShell Active Directory module, but no clue how to get the path.

    PS C:\Users\hansi> get-adgroup "AXX G Doc Users"
    
    DistinguishedName : CN=AXX G Doc Users,OU=Groups,OU=AXX,OU=AT,OU=Europe,OU=COMP Group,DC=comp,DC=com
    GroupCategory     : Security
    GroupScope        : Global
    Name              : AXX G Doc Users
    ObjectClass       : group
    ObjectGUID        : 589de0db-105e-4cfe-a231-692573248487
    SamAccountName    : AXX G Doc Users
    SID               : S-1-5-21-796845957-79056718-725345543-16367
    
  • florian.isopp
    florian.isopp almost 8 years
    succeeded with: get-adgroup -identity "AXX G Doc Users" -properties canonicalname