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 (215k 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
0 answers

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 by TheLexicon (180 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 (1.2k points)
0 votes
1 answer

We have Exchange 2010 OnPrem and Office 365 Exchange Online in a full Hybrid environment. Using AD Active Sync. We have now moved all of our mailboxes to Exchange ... manage the OnPrem Exchange AD Attributes after the last Exchange 2010 server is removed?

asked Jun 1, 2020 by StevePogue (20 points)
0 votes
1 answer

Hi Support, I'm trying to use adaxes to send a couple of branded emails with User information such as UPN and First name. I've written some HTML email code but would ... <table class="wrapper" width="100%" cellspacing="0" align=center cellpadding="0">

asked Feb 18, 2020 by richarddewis (240 points)
2,779 questions
2,512 answers
6,574 comments
26,511 users