Hello I am trying to build a report. This report should have any user in it that has a True for adm-customboolean12. I am trying this script for testing:
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$containerDN = "MyOU(removed DN for security)"
# Connect to the Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
$searcher = $service.OpenObject("Adaxes://$containerDN", $null, $null, 0)
$searcher.Criteria = New-AdmCriteria "user" {adm-customAttributeBoolean12 -eq 'True'}
$searcher.SearchScope = "ADS_SCOPE_SUBTREE"
try
{
# Execute search
$searchResultIterator = $searcher.ExecuteSearch()
foreach ($searchResult in $searchResultIterator.FetchAll())
{
$userPath = $searchResult.AdsPath
$user = $service.OpenObject($userPath, $null, $null, 0)
$UN = $User.Name
$Context.LogMessage("$User", "Information")
}
}
finally
{
# Release resources
$searchResultIterator.Dispose()
}
I have a test user set up in the OU but the searcher never finds them.