Hide server names in error messages

Error messages displayed by Adaxes can contain the name of the server where the operation was performed. Use the below script to enable or disable displaying server names in error messages.

Note

Only Adaxes service administrators have the rights to enable and disable displaying server names in error messages.

In the script:

  • $serviceHost - the host name of the computer where the Adaxes service is installed.
  • $displayServerNames - a value indicating whether server names should be displayed in error messages.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$displayServerNames = $False

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

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Configuration Set Settings' container.
$path = $admService.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $admService.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

# Update the setting.
$settings.SetParameter("Adsi.ShowServerInErrorMessages", $displayServerNames)

View the current setting

To check whether Adaxes is configured to display server names in error messages, use the below script. In the script, the $serviceHost variable specifies the host name of the computer where the Adaxes service is installed.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"

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

# Prompt for credentials.
$credential = Get-Credential

# Bind to the 'Configuration Set Settings' container.
$path = $admService.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $admService.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

Write-Host "Display server names in error messages: "`
    $settings.GetParameter("Adsi.ShowServerInErrorMessages")