0 votes

Hi,

we save the start date of employees within adm-CustomAttributeDate1 and I would like to fetch them based on this field.

My criteria looks like this, however I get no response

New-AdmCriteria "user" {adm-CustomAttributeDate1 -occurredMoreThan 5}

Full script

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$containerDN = "OU=XX,DC=XX,DC=XX"

# 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-CustomAttributeDate1 -occurredMoreThan 5}
$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)
        Write-Host $user.Name
    }
}
finally
{
    # Release resources
    $searchResultIterator.Dispose()
}

What I want to achieve:

  • When the start date is reached, add the user to a specific group

I also tried rule-based groups and business units, but none of them allow me to use the adm-CustomAttributeDate1 as search filter.

ago by (2.1k points)

1 Answer

0 votes
ago by (305k points)
selected ago by
Best answer

Hello,

Unfortunately, the behavior is by design. Adaxes custom attributes cannot be used in criteria. This is true for both scripts and rule-based groups. The easiest way for you to achieve the desired is to use a scheduled task like below. image.png

0

Ok, thanks for clarification.

Is it planned to add such attributes as search criteria in future?

+1

Hello,

Yes, it is planned. However, there is currently no ETA for the feature.

Related questions

0 votes
1 answer

I need a list of all the URLs that Adaxes creates in IIS on the server Adaxes is installed on.

asked Feb 6, 2020 by DaralenManta (20 points)
0 votes
0 answers

Hello there, We have guest accounts created in AD (on our DMZ DC) that use the first initial + last name format for username with the last 4 digits of their mobile ... there any special way I should be updating a username and UPN from PowerShell? Thanks, Chris

asked Jul 13, 2018 by Bowman4864 (270 points)
0 votes
1 answer

Please reference https://www.adaxes.com/questions/749/find-managed-object-on-deprovision Looking for a script that will show if the person being deprovisioned is an 'Approver' ... above question is similar but is quite old and I don't believe works anymore.

asked Jan 13 by dhodgin (80 points)
0 votes
1 answer

I have a scheduled task that runs the following PowerShell script. $user = New-AdmUser -Server $domain -AdaxesService localhost -Path $workdayDn -ChangePasswordAtLogon $true -PassThru - ... ) over all objects. I'm stumped! Any help would be super appreciated.

asked Sep 5, 2024 by emeisner (160 points)
0 votes
1 answer

This script description says it can find the manager via FullName Distinguished name or Display name. Wondering if we can change it to use employeeID or SamAccountName.

asked Oct 24, 2022 by mightycabal (1.1k points)
3,736 questions
3,414 answers
8,635 comments
550,296 users