The script enables the auto-logon feature for the specified Web interface. Execute the script in Windows PowerShell on the computer where Adaxes ADSI provider is installed. For details on how to install it, see https://adaxes.com/sdk/HowDoI.InstallAdsiProvider/. When prompted, specify the credentials of the Adaxes service account (specified during Adaxes installation).
Parameters:
- $webApplicationName - Specifies the name of the Web interface to enable auto-logon for.
- $serviceHost – Specifies the host name of the computer where Adaxes service is installed.
PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$webApplicationName = "HelpDesk" # TODO: modify me
$serviceHost = "localhost" # 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 WebUI configuration
$webuiConfigPath = $service.Backend.GetConfigurationContainerPath("WebUIConfigurationContainer")
$webuiConfigContainer = $service.OpenObject($webuiConfigPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$config = $webuiConfigContainer.GetConfig($webApplicationName)
# Update autologon
$json = '{"autoLogon": { "logonType": 1 }, "useCommonSignInSettings": false}'
$config.FromJson($null, $json)