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 (14.1k 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

I am noticing a large amount of PowerShell Transcript files in the Adaxes SA accounts Documents folder. These are different than the logging feature which has a very ... Can I configure these transcripts in any way to manage their space consumption/retention?

asked Nov 5 by SysADM (50 points)
0 votes
1 answer

Hi team, I would like to update allowed values of a property pattern and found this script: https://www.adaxes.com/script-repository/add-new-allowed-property-value-to-a- ... multiple new values? I tried already a foreach around it, but not working properly :/

asked Sep 2 by wintec01 (1.5k points)
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.5k points)
3,548 questions
3,239 answers
8,232 comments
547,814 users