8

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
  • 183
  • 1
  • 1
  • 5

1 Answers1

7

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.

natxo asenjo
  • 5,739
  • 2
  • 26
  • 27