Script repository
The scripts enable or disable the specified web interface.
Script 1: using Adaxes scheduled task
To execute the script, create a scheduled task configured for the Domain object type and add a managed domain to the Activity Scope of the task. The domain will only be used to trigger execution of the scheduled task.
Parameters
$webUIConfigurationName- the name of the web interface to enable or disable.$enabled- set to$trueto enable the specified web interface or to$falseto disable it.
$webUIConfigurationName = "HelpDesk" # TODO: modify me
$enabled = $false # TODO: modify me
# Get web interface configuration.
$webuiConfigPath = $Context.GetWellKnownContainerPath("WebUIConfigurationContainer")
$webuiConfigContainer = $Context.BindToObject($webuiConfigPath)
$webUIConfiguration = $webuiConfigContainer.GetConfiguration($webUIConfigurationName)
# Update configuration
$webUIConfiguration.Enabled = $enabled
$webUIConfiguration.SetInfo()Script 2: external execution
Execute the script in Windows PowerShell on the computer where Adaxes service is installed. When prompted, specify the credentials of the Adaxes service account (entered during Adaxes installation).
Parameters
$webUIConfigurationName- the name of the web interface to enable or disable.$enabled- set to$trueto enable the specified web interface or to$falseto disable it.
Import-Module Adaxes
$webUIConfigurationName = "HelpDesk" # TODO: modify me
$enabled = $false # TODO: modify me
# Connect to the Adaxes service.
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")
# Get web interface configuration.
$webuiConfigPath = $admService.Backend.GetConfigurationContainerPath("WebUIConfigurationContainer")
$credential = Get-Credential
$webuiConfigContainer = $admService.OpenObject($webuiConfigPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$webUIConfiguration = $webuiConfigContainer.GetConfiguration($webUIConfigurationName)
# Update configuration
$webUIConfiguration.Enabled = $enabled
$webUIConfiguration.SetInfo()
Comments 0
You must be signed in to comment.