0 votes

I have admCustomattributes assigned to certain groups via powershell script using Set-ADMGroup -Identity $Group.SID -Add $CustomAttributes -AdaxesService $Adaxes

When I view the group through the web gui, I can see the attributes successfully added. However I would like to be able to perform operations on these groups based on the attributes assigned. The operations are quiet complicated and for a large number of groups so automating it via powershell would be my preferred option.

Get-AdmGroup <Group> -Properties * does not include the custom attributes in the result. Can you advise how I can display and therefore filter these results based on these attributes?

by (20 points)

1 Answer

0 votes
by (12.3k points)

Hello,

To get values of Adaxes custom attributes when using cmdlets from the Adaxes PowerShell module, you need to specify the property names in the Properties parameter. The below example returns the MyGroup object with the value of the adm-CustomAttributeText1 and adm-CustomAttributeText2 properties:

Get-AdmGroup MyGroup -Properties @("adm-CustomAttributeText1", "adm-CustomAttributeText2") -AdaxesService localhost

To find all groups with certain values in custom attributes, you can use the following approach:

Get-AdmGroup -Filter * -Properties @("adm-CustomAttributeText1", "adm-CustomAttributeText2") -AdaxesService Localhost | Where-Object {$_."adm-CustomAttributeText1" -eq "MyValue1" -and $_."adm-CustomAttributeText2" -eq "MyValue2"}

Alternatively, you can consider using the Adaxes ADSI provider to connect to the service, bind to an object, and get property values. For information on how to write ADSI scripts, have a look at the following SDK article: https://www.adaxes.com/sdk/WritingAdsiScripts.

Related questions

0 votes
1 answer

We've the following script we want to use in Adaxes to create as part of user creation, to ask if the user will need a AWS workspace, then asks employeetype for different ... "Error") exit(-1) } else { $Context.LogMessage("Created workspace", "Information") }

asked May 3 by Plusa (20 points)
0 votes
1 answer

Hi, we just recently installed Adaxes and would like to implement a PowerShell script that I have previously written which cleans up user objects if they have been manually ... to perform the operation Stack trace: at &lt;ScriptBlock&gt;, &lt;No file&gt;".

asked Oct 2, 2023 by Mark.Monaco (20 points)
0 votes
1 answer

Hi, is it possible to manage rule based groups with Powershell and change criterias? Basically we would like to generate one "dynamic" group for every manager with all their direct and indirect reports

asked May 31, 2023 by wintec01 (1.2k points)
0 votes
1 answer

I'm creating a powershell script to handle all the 'modify user' steps, instead of having them be individual steps in Adaxes. This script runs after we fill out a form. A ... empty parameter considered as either a "tab" or "4 spaces" ? Thanks for your help.

asked Dec 12, 2022 by lw.fa (130 points)
0 votes
1 answer

I used the script below to try and accomplish this but I get an error. I did try to leave a comment but it would not let me. I tried running ... .adaxes.com/script-repository/add-users-located-in-particular-organizational-units-to-unmanaged-accounts-s178.htm

asked Nov 14, 2022 by raul.ramirez (210 points)
3,407 questions
3,104 answers
7,898 comments
545,752 users