0 votes

I'm getting a syntax error on this command and I can't figure out what I'm doing wrong:

$criteria = New-AdmCriteria "user" {adm-CustomAttributeInt2 -empty $false -and accountExpires -expired -eq $false}

New-AdmCriteria : The criteria is invalid. Syntax error at position 68. At line:1 char:13

ago by (110 points)

1 Answer

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

Hello,

You are missing the -Expression parameter. Also, the part for account expiration is incorrect. There should be no -eq operator. Finally, it should be as follows:

$criteria = New-AdmCriteria "user" -Expression {adm-CustomAttributeInt2 -empty $false -and accountExpires -expired $false}

However, even with fixing the syntax, the criteria will not work. The thing is it is no possible to use Adaxes custom attributes in search criteria.

Related questions

0 votes
1 answer

Hi there! I'm currently running a demo of Adaxes, with the goal of having the system configured so it's our HR team creating users, rather than help desk ... to the person who created the account Any direction would be greatly appreciated. Cheers Matt

asked Aug 24, 2017 by mmcdougall (50 points)
0 votes
1 answer

I think this started happening back in August when we updated to the current version (3.13.18.106.0). We are not sure though because this only affects the web page ... We would prefer not to allow access through a firewall for this. Screenshot of the error:

asked Nov 23, 2020 by mark.it.admin (2.3k points)
0 votes
1 answer

Hey I found this code for my Custom Command to autofill Description. Does anyone know how to modify it to handle grandparent i.e. go two levels up? $parent = ... .Put("Description", $parent.Get("name")) $Context.TargetObject.SetInfo() Best Regards Debarase

asked Nov 9, 2018 by debarase (100 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 <ScriptBlock>, <No file>".

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

I am creating a new scheduled task and form. We would like to have the ability to schedule the reassignment of a staff member to a different location in the future. ... context, my manager won't necessarily know when he tries to move somebody. Thanks everybody

asked May 21, 2020 by jcalvert (60 points)
3,511 questions
3,202 answers
8,152 comments
547,522 users