0 votes

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.
I would like to have something similar to pulling regular AD extension attributes. For example:

$adUsers = Get-adUser -Filter * -Properties extensionattribute1
$adUsers | group extensionattribute1

This code will help me understand how many objects have extensionattribute1 populated and what values are there.
How can I get similar output for virtual attributes?

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.
Viewing extension attributes in AD can be done like this:

get-aduser username -pro * |  fl
by (760 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

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

Related questions

0 votes
1 answer

I would like to show a couple of Adaxes Virtual Attributes in the Web Portal. I've added them in the Configuration, see the 1st screenshot below. I've ... . Any help? Virtual Attributes added Security Role has permissions Virtual Attributes not showing up

asked Jul 29, 2020 by nate2 (90 points)
0 votes
1 answer

Im trying to rename "Extension attribute 1 and 2" to something legible for users. Is there a way to cahnge the dsiaply name myslef like how other attributes are done?

asked Feb 17, 2023 by raul.ramirez (210 points)
0 votes
1 answer

Hi I know this isn't currently possible, but is the ability to use Adaxes custom attributes in a Business Unit Criteria something you are looking into? It would make the business units far more powerful and usable than they currently are. Thanks Matt

asked Nov 30, 2022 by chappers77 (2.0k points)
0 votes
1 answer

So I need to export a list of all user's Line URI's to a CSV file. Running Adaxes 2021 Version 3.14.18804.0 (64 bit) and Teams Powershell 4.1.0 ... a Microsoft 365 account } finally { # Close the connection and release resources Disconnect-MicrosoftTeams }

asked Aug 4, 2022 by TheLexicon (200 points)
0 votes
1 answer

Hi We've currently have 2 instances of Adaxes running in our environment. The first is a legacy standalone system and the new is a HA environment. We needed to get some things ... system so that it can be wiped and rebuilt. Is tihs possible at all? Thanks Matt

asked Nov 12, 2020 by chappers77 (2.0k points)
3,346 questions
3,047 answers
7,781 comments
544,980 users