Script repository

Specify access control for web interface

Updated on: Jan 18, 2026, Views: 1670

Web interface configuration

The script sets a user or group as an access control trustee for a web interface. Execute the script in Windows PowerShell on the computer where Adaxes service is installed. When prompted, specify the credentials of the Adaxes service account (specified during Adaxes installation).

Parameters

  • $webApplicationName - the name of the web interface whose configuration will be updated.
  • $trusteeDN - the distinguished name (DN) of a user or security group that will be the only allowed access control trustee for a web interface. For information on how to get the DN of a directory object, see Get the DN of a directory object.
  • $serviceHost - the host name of the computer where Adaxes service is installed.
Import-Module Adaxes

$webApplicationName = "HelpDesk" # TODO: modify me
$serviceHost = "localhost" # TODO: modify me
$trusteeDN = "CN=John Smith,OU=Users,DC=company,DC=com" # TODO: modify me

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

# Prompt for credentials.
$credential = Get-Credential

# Get trustee Guid.
$trustee = $service.OpenObject("Adaxes://$trusteeDN", $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$trusteeGuid = [Guid]$trustee.Get("objectGuid")

# Get WebUI configuration.
$webuiConfigPath = $service.Backend.GetConfigurationContainerPath("WebUIConfigurationContainer")
$webuiConfigContainer = $service.OpenObject($webuiConfigPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$config = $webuiConfigContainer.GetConfig($webApplicationName)

# Update access control.
$json = '{"accessControlForUsers": {"type": 1, "allowedSpecificItems": [{"referenceType": 0, "Key": "' + $trusteeGuid + '"}]}}'
$config.FromJson($null, $json)

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.