Hello,
How could I get an easy overview of virtual attributes currently in use. I mean return a list of attributes with values if there are any on any user object in AD.
Unlike extension attributes, custom attributes are not stored in Active Directory and cannot be used in a search filter. For an example of a search by Adaxes custom attribute, have a look at the following script from our repository: https://www.adaxes.com/script-repositor ... ty-s43.htm.
Also how can I get a list of all virtual attributes currently available and if they have been renamed? I want to access that information through scripting.
The map of Property Display Names is stored in Adaxes backend. You can access it using a script like the following:
$service = "localhost" # TODO: modify me
$user = "user@domain.com" # TODO: modify me
$password = "P@ssw0rd" # TODO: modify me
# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly($service)
# Bind to the 'Configuration' container
$configPath = $admService.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$configContainer = $admService.OpenObject($configPath, $user, $password, 0)
$configContainer = [Softerra.Adaxes.Interop.Adsi.Management.IAdmAttributeFriendlyNamesOps]$configContainer
$languages = $configContainer.GetLanguages()
foreach($language in $languages)
{
$friendlyNames = $configContainer.GetAttributeFriendlyNames($language, "ADM_GETATTRFRIENDLYNAMESMODE_USERDEF")
Write-Host "$language - " ($friendlyNames | % { $a = $_.AttributeName; $f = $_.GenericFriendlyName; return "$a=$f" })
}
The GetAttributeFriendlyNames method accepts the following enumerators as the second parameter:
# The method returns merged attribute friendly names.
ADM_GETATTRFRIENDLYNAMESMODE_MERGED = 0,
# The method returns predefined attributed friendly names only.
ADM_GETATTRFRIENDLYNAMESMODE_PREDEFINED = 1,
# The method returns user-defined attribute friendly names only.
ADM_GETATTRFRIENDLYNAMESMODE_USERDEF = 2