diff --git a/src/PSADTree/Commands/GetADTreePrincipalGroupMembershipCommand.cs b/src/PSADTree/Commands/GetADTreePrincipalGroupMembershipCommand.cs index 314c606..539812c 100644 --- a/src/PSADTree/Commands/GetADTreePrincipalGroupMembershipCommand.cs +++ b/src/PSADTree/Commands/GetADTreePrincipalGroupMembershipCommand.cs @@ -72,6 +72,11 @@ protected override void ProcessRecord() using PrincipalSearchResult search = principal.GetGroups(); foreach (Principal parent in search.GetSortedEnumerable(_comparer)) { + if (ShouldExclude(parent, _exclusionPatterns)) + { + continue; + } + GroupPrincipal groupPrincipal = (GroupPrincipal)parent; TreeGroup treeGroup = new(source, null, groupPrincipal, 1); Push(groupPrincipal, treeGroup);