0 votes

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.

ago by (1.1k points)

1 Answer

+1 vote
ago by (299k points)

Hello,

Unfortunately, there is no possibility to use Adaxes custom attributes in search criteria. The behavior is by design, but we have the feature in our TODO list. The only option is to bind to each and every found user and check the attribute value.

As another option, you can use a built-in report, Users with non-empty properties. Out of the box, the report is located in container Reports\All Reports\Users.

Related questions

0 votes
1 answer

We have 3 email domains. 1 primary and 2 subsidary companies. I'm needing to automate setting the email domain during user creation based on department. See attached ... to be able to automate this for ongoing maintenance if users move between departments.

asked 4 days ago by browndervilleb (20 points)
0 votes
1 answer

Hi: I am trying to create a business rule that will stop a value change based on the existing value. For example, if the telephonenumber is 1234 for a group and has to ... the value it uses is the incoming value of the change, not the existing value. Thanks!

asked Jun 3, 2022 by crobitaille (80 points)
0 votes
1 answer

For example: This integration with SAP SuccessFactors/Active Directory will create the users without the knowledge of Adaxes but we still want to do automation around creating ... created users report and run this automation based on the result of the report?

asked Feb 7 by DarrenFisk (100 points)
0 votes
1 answer

This search script works well. Thank you. I would like to search for all scheduled tasks based on Activity Scope. I would like to delete all scheduled tasks that are ... be assigned over a specific user. What would be the best approach under this circumstance?

asked Apr 11, 2024 by Moodie007 (70 points)
0 votes
1 answer

Hi, I try to make a report for our SAM to show all users with a specific license. But I fail to even find anything. I tried, among many ... .DirectorySearcher.AppendFilter("(adm-O365AccountLicenses=POWER_BI_STANDARD)") But I get nothing. Please advice.

asked May 20, 2021 by KristofferJ (80 points)
3,648 questions
3,336 answers
8,432 comments
548,983 users