From 5cdffc88baa8d204fb4391a606ee18e267e86f85 Mon Sep 17 00:00:00 2001 From: Santiago Squarzon Date: Tue, 3 Sep 2024 10:43:16 -0300 Subject: [PATCH] adding sorting for principal group membership command --- .../Commands/GetADTreePrincipalGroupMembershipCommand.cs | 5 +++++ 1 file changed, 5 insertions(+) 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);