Hi,
We were actually able to determine the needed script to pull in the group filter data which resulted in a similar report to what you mentioned so this should be resolved.
For context, the below is what we used behind our report to successfully pull the correct groups when given a property name and value:
$membershipTypeProperty = "adm-GroupMembershipType"
$distinguishedNameProperty = "distinguishedName"
$filter = "(%param-PropertyName%=%param-PropertyValue%)"
try
{
$Context.DirectorySearcher.SearchParameters.Filter = "(objectCategory=group)"
# Add property necessary to generate the report
$Context.DirectorySearcher.SearchParameters.PropertiesToLoad.Add($membershipTypeProperty)
$Context.DirectorySearcher.SearchParameters.PropertiesToLoad.Add($distinguishedNameProperty)
$searchResultIterator = $Context.DirectorySearcher.ExecuteSearch()
while ($Context.MoveNext($searchResultIterator))
{
$searchResult = $searchResultIterator.Current
$membershipType = [int]$searchResult.Properties[$membershipTypeProperty].Value
if ($membershipType -eq 1)
{
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")
# Bind to the group
$groupDN = $searchResult.GetPropertyByName("distinguishedName").Values[0]
$group = $admService.OpenObject("Adaxes://$groupDN", $NULL, $NULL, 0)
$rules = $group.MembershipRules
foreach ($rule in $rules) {
if($rule.Type -eq "ADM_BUSINESSUNITMEMBERSHIPTYPE_QUERY") {
if($rule.Filter -match $filter) {
$Context.Items.Add($searchResult)
$Continue
}
}
}
}
}
}
finally
{
if ($searchResultIterator)
{
$searchResultIterator.Dispose()
}
}