Expanding Active Directory (AD) Distribution Group (DG) members recursively…

In one of my projects there was a requirement to get the unique list of members from a given DG, which may have multiple levels of nested DGs.  So, I thought of using the “System.DirectoryServices” namespace with “DirectoryEntry” & “DirectorySearcher” classes.  But the challenge was to recursively expand the nested DGs and eliminate the duplicates…

0