Script repository

Add value to drop-down list parameter

Updated on: Jan 18, 2026, Views: 1951

Reports

The script adds a new value to a drop-down list parameter of a report. The script should be executed in Windows PowerShell. When prompted, specify the credentials of the Adaxes service account (entered during Adaxes installation).

Parameters

  • $serviceHost - the host name of the computer where Adaxes service is installed.
  • $reportDN - the distinguished name (DN) of the report to update. For information on how to get the DN, see Get the DN of a directory object.
  • $parameterId - the identifier of the report drop-down list parameter to update. For information on how to obtain identifiers of report parameters, see View information on report parameters.
  • $valueToAdd - the value to add to the parameter.
Import-Module Adaxes

$serviceHost = "localhost" # TODO: modify me
$reportDN = "CN=My Report,CN=Reports,CN=Reports Root,CN=Configuration Objects,"+
    "CN=Adaxes Configuration,CN=Adaxes" # TODO: modify me
$parameterId = "ADAXESPARAMID:{3664233f-3c73-4cae-8bef-50ded4ee0d0c}" # TODO: modify me
$valueToAdd = "My value" # TODO: modify me

# Prompt for credentials.
$credential = Get-Credential

# Connect to the Adaxes service.
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly($serviceHost)

# Retrieve report configuration.
$report = $admService.OpenObject("Adaxes://$reportDN", $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$configuration = $report.GetConfiguration()

# Get the parameter.
$reportParameters = $configuration.Parameters
$parameter = $reportParameters | Where {$_.ID -eq $parameterId}

# Add parameter value.
$newParameterValue = $parameter.CreateValue()
$newParameterValue.Value = $valueToAdd
$parameter.Values += $newParameterValue

# Update report.
$configuration.Parameters = $reportParameters
$report.SetConfiguration($configuration)

Comments 0

You must be signed in to comment.

    Got questions?

    Support Questions & Answers

    We use cookies to improve your experience.
    By your continued use of this site you accept such use.
    For more details please see our privacy policy and cookies policy.