algorithm - List circular group membership from active directory -
We have 40K + groups in our Active Directory and we are facing the problem of circular nested groups which Are causing problems for.
Do anyone know how a circular group membership exists through full circuits?
G1 -> G2 - & gt; G3 - & gt; G4 - & gt; G1
How do I list it below.
Here you go, a modified version of this code should do the trick as well as the book Check out, I often refer to its excellent desk resource.
'This VBScript code prints the nested membership of a group. '------------------------------------------------- -------------- 'Robbie Allen' ISBN: 0-596-00466-4 '------------- "Book of Active Directory Cookbook" From ------------------------------------------------- - '------ SCRIPT configuration ------ StroggerDN = "& lt; GroupDN & gt;" 'Eg cn = SalesGroup, ou = group, dc = rallencorp, dc = com' ------ end configuration --------- strSpaces = "set" dicSeenGroupMember = CreateObject ("Scripting.Dictionary") WScript. Echo "Members" & amp; StrGroupDN & amp; ":" Display Member "LDAP: //" & amp; StrGroupDN, strSpaces, dicSeenGroupMember function DisplayMembers (strGroupADsPath, strSpaces, dicSeenGroupMember) set objGroup = GetObject (strGroupADsPath) objGroup.Members Wscript.Echo strSpaces & for each objember; ObjMember.Name if objMember.Class = "group" again if dicSeenGroupMember.Exists (objMember.ADsPath) then Wscript.Echo strSpaces & amp; "^ Group member already seen" & amp; _ Rest dinSeenGroupMember.Add objMember.ADsPath "(stop to avoid loop)", 1 DisplayMembers objMember.ADsPath, strSpaces & amp; "", _DicSeenGroupMember end if the end end function
Comments
Post a Comment