The script activates the license key for Adaxes. In the script, the $licensePath variable specifies the path to the license key. When prompted, specify the credentials of the Adaxes service account (specified during installation).
PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$licensePath = "C:\scripts\license.admlic" # TODO: modify me
# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Prompt for credentials.
$credential = Get-Credential
# Bind to the 'Configuration' container.
$configurationSetSettingsPath = $service.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$configurationSetSettings = $service.OpenObject($configurationSetSettingsPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
# Set License.
$license = [System.IO.File]::ReadAllBytes($licensePath)
$configurationSetSettings.SetLicense($license)