Get-ADPrincipalGroupMembership RRS feed

  • Frage

  • Get-ADPrincipalGroupMembership "username" | select name | sort name

    How can I get way to AD Domain Services Folder

    Freitag, 7. Juli 2017 09:32


  • vimorgun that's the German Powershell forum here. There is an english forum as well.

    What you see in the ADUC as the "AD Domain Services Folder" is actually named CanonicalName. 

    Get-ADPrincipalGroupMembership "username" | 
        Foreach-Object {
            Get-ADGroup -Identity $_.Name -Properties CanonicalName
        } |
            Select-Object -Property Name, CanonicalName, @{Name='ADDomainServicesFolder';Expression={Split-Path -Path $_.CanonicalName}}
    Edit: ... or more precisely it's the parent folder of the group. I added a calculated property to the code to show this.

    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Freitag, 7. Juli 2017 10:02