Эх сурвалжийг харах

also show parent object of each group

Tobias Simetsreiter 2 жил өмнө
parent
commit
27fa01dadb

+ 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;