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.

Script Repository

Activate license key

January 20, 2023 Views: 805

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).

Edit Remove
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)
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers