I am attempting to use the script here: https://www.adaxes.com/sdk/REST_AccessControl/

Yet when I run it with

$serviceHost = "localhost"
$allowAuthOf = @(
    "CN=Adaxes API Service Account,CN=Users,DC=contoso,DC=com",
    "CN=API Administrators,OU=Groups,DC=contoso,DC=com"
)
$replace = $true  

After entering my credentials I get:

Supply values for the following parameters:
Exception calling "FromJson" with "2" argument(s): "Value cannot be null.
Parameter name: id"
At line:58 char:1
+ $restApi.FromJson($null, ($config | ConvertTo-Json -Depth 10))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException
ago by (130 points)

1 Answer

ago by (17.1k points)
0 votes

Hello,

Thank you for pointing out the issue. We have updated the scripts in the article. Please refresh the page to access and use the updated version.

ago by (130 points)
0

That has worked! The scripts to add, remove and view current REST API allowed users/groups are now working as expected.

However, several of the other scripts to manage API are still broken.

Examples:

Configuring Brute Force: https://www.adaxes.com/sdk/REST_BruteForceProtection/

GAC    Version        Location                                                                                                                                                                
---    -------        --------                                                                                                                                                                
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Softerra.Adaxes.Adsi\v4.0_3.19.25611.0__43a637781bd9a3c2\Softerra.Adaxes.Adsi.dll                                            
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Exception calling "ToJson" with "1" argument(s): "'e' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:23 char:1
+ $config = $restApi.ToJson("{elements: ['BruteForceProtection']}") | C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceJsonException

The property 'enabled' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:24 char:1
+ $config.bruteForceProtection.enabled = $enableBruteForceProtection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

Exception calling "ToJson" with "1" argument(s): "'e' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:29 char:1
+ $config = $restApi.ToJson("{elements: ['BruteForceProtection']}") | C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceJsonException

The property 'delayResponseEnabled' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:33 char:5
+     $config.bruteForceProtection.delayResponseEnabled = $true
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'delayResponseAttemptsCount' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:34 char:5
+     $config.bruteForceProtection.delayResponseAttemptsCount = $maxFai ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

WARNING: Settings will be saved but will not take effect. 
        Brute force protection is disabled.
Exception calling "ToJson" with "1" argument(s): "'e' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:52 char:1
+ $config = $restApi.ToJson("{elements: ['BruteForceProtection']}") | C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceJsonException

The property 'showGenericErrorMessageEnabled' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_Config_BruteForce.ps1:53 char:1
+ $config.bruteForceProtection.showGenericErrorMessageEnabled = $generi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

WARNING: Settings will be saved but will not take effect. 
        Brute force protection is disabled.

Checking Brute Force Protection

GAC    Version        Location                                                                                                                                                                
---    -------        --------                                                                                                                                                                
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Softerra.Adaxes.Adsi\v4.0_3.19.25611.0__43a637781bd9a3c2\Softerra.Adaxes.Adsi.dll                                            
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Exception calling "ToJson" with "1" argument(s): "'e' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_View_BruteForceProtection.ps1:18 char:1
+ $config = $restApi.ToJson("{elements: ['BruteForceProtection']}") | C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceJsonException

Brute force protection is disabled.

Restricting allowed operations https://www.adaxes.com/sdk/REST_AllowedOperations/

GAC    Version        Location                                                                                                                                                                
---    -------        --------                                                                                                                                                                
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Softerra.Adaxes.Adsi\v4.0_3.19.25611.0__43a637781bd9a3c2\Softerra.Adaxes.Adsi.dll                                            
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Exception calling "ToJson" with "1" argument(s): "'e' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1."
At C:\Users\user\Desktop\Adaxes Stuff\Scripts\API_SetAllowedOperations.ps1:31 char:1
+ $config = $restApi.ToJson("{elements: ['Operations']}") | ConvertFrom ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ServiceJsonException

ago by (17.1k points)
0

Hello,

Thank you for specifying. The scripts in the mentioned articles work fine with Adaxes 2026.2. According to the provided script output, you are using Adaxes 2026.2 Update 1 (build number 3.19.25611).

Please note that the scripts in the articles are periodically updated. If you have previously saved copies of these scripts, please make sure you are not using them. Instead, copy the latest versions directly from the SDK articles.

If you still encounter errors when executing the scripts copied directly from the SDK articles, please provide the scripts you are using in TXT format. You can post them here or send them to support@adaxes.com.

Related questions

On rare occasions, I get the following message when viewing the exchange properties; 'The operation cannot be executed by any available API.' This only happens to a ... these properties are displayed for users. Has anyone else experienced this issue at all?

asked Sep 1, 2016 by Martyn (70 points)
0 votes
1 answer

We have users with a value of a space for their mobile number and telephone number. I would like to figure out who these users are and null the value. Or if the value contains a number leave it alone. if it does not have a number then null the value.

asked Nov 15, 2022 by B_Witmer (40 points)
0 votes
1 answer

I am trying to build a custom command to add a specific user to a rule based group in adaxes and I am curious if it is something we can use the API to complete?

asked Mar 7, 2025 by Brian (40 points)
0 votes
1 answer

Hi, { "criteria": { "objectTypes": [ { "type": "USER", "items": { "type": 1, "items": [ { "type": 0, "property": "accountDisabled", "operator": "eq" ... ": { "isDisabled": true, Please share the right request JSON to get the required result. Thanks, Lohith

asked Oct 3, 2024 by lom (20 points)
0 votes
1 answer

Hello, We encoutered an issue with Adaxes in default configuration. We are mainly using Adaxes for its REST API, to automate identity lifecycle with our HRIS. We tried to update ... got enforced even on an API REST attribute change? If so how to disable it?

asked Aug 18, 2022 by ygini (240 points)
0 votes
1 answer