0 votes

Hello

I have a problem with a powershell script to disable users in AD

i have the attribute "adm-customatributtex1" I set as "Pension" i try to retrieve the value of the attribute but what appears is not the value but "CustomattributeText1"

`Import-Module Adaxes

$data=Get-AdmUser -Filter * -SearchBase "OU=PrimaTes,DC=wandavision,DC=net"

foreach($user in $data) {

Write-Output $user.adm-CustomattributeText1;

}`

If I display change the script like this

`$data=Get-AdmUser -Filter * -SearchBase "OU=PrimaTes,DC=wandavision,DC=net"

foreach($user in $data) {

Write-Output $user.Pension;

}`

No output

by (100 points)

1 Answer

0 votes
by (220k points)

Hello,

Adaxes custom attributes are only available in Adaxes and not present in AD itself. As such, to obtain the attribute value the -AdaxesService parameter is required when running Adaxes cmdlets. Also, you need to explicitly specify custom attributes using the -Properties parameter. Finally, you should have something like the following:

$users = Get-AdmUser -Filter * -SearchBase "OU=PrimaTes,DC=wandavision,DC=net" -AdaxesService localhost -Properties @("adm-CustomAttributeText1")

foreach($user in $users)
{
    $user
}
0

Thank You

Related questions

0 votes
1 answer

Currently, when I disable a user account in Adaxes, the group memberships of the user remain intact. I'd like to automate the removal of group memberships such as distribution ... a list of groups/DL that the user was previously in and removed from. Thanks!

asked Nov 3, 2021 by jayden.ang (20 points)
0 votes
1 answer

Hello, I'd like setup a new custom command on the Administrator dashboard that would run the following tasks against a disabled user account simultaneously. Enable their account ... the email when using the %unicodePwd% value. Is there a workaround for this?

asked Apr 23, 2020 by sirslimjim (400 points)
0 votes
1 answer

We have a business need for automating and controlling the creation of service accounts in our AD. For example, we want all new service accounts to start with "svc_" for ... customize the "New User" form to create a "New Service Account" workflow in Adaxes?

asked Sep 10, 2021 by joshua.lapchuk (50 points)
0 votes
1 answer

As part of our HR onboarding process, they need to specify non-AD integrated software requirements. Is there a way to have a customised field on the form that when ticked or ... say the name of the software and have it linked to a particular field in AD.

asked Apr 15, 2020 by russmerriman (40 points)
0 votes
1 answer

I have two domains where a sub-set of users are a mirror of each other. When a deprovision is run in the primary domain I would also like it to perform the ... on as well, possibly by calling a separate custom command where I can have different steps.

asked Mar 25, 2016 by Infounlim (470 points)
2,733 questions
2,470 answers
6,460 comments
1,339,626 users