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