소스 검색

also show parent object of each group

Tobias Simetsreiter 2 년 전
부모
커밋
27fa01dadb
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      bin/Get-ADUserNestedGroups.ps1

+ 6 - 1
bin/Get-ADUserNestedGroups.ps1

@@ -35,7 +35,12 @@ If($ADObject)
         If(($Groups | Where-Object {$_.DistinguishedName -eq $GroupDistinguishedName}).Count -eq 0)
         {
             #Add group to array.
-            $Groups +=  $CurrentGroup;
+            $Groups +=  [PSCustomObject]@{
+                DistinguishedName=$CurrentGroup.DistinguishedName
+                Name=$CurrentGroup.Name
+                ObjectClass=$CurrentGroup.ObjectClass
+                Parent=$DistinguishedName
+            };
 
             #Get recursive groups.      
             $Groups = &$PSCommandPath -DistinguishedName $GroupDistinguishedName -Groups $Groups;