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 (3.9k 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 by nate2 (250 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 by StevePogue (250 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 by richarddewis (1.5k points)
0 votes
1 answer

HI support, I just have a question about deprovisioning Users. After I deleted a user from the Active Directory, it can be, in some Cases, the I have to restore them. ... Adaxes Custom Attribute are lost. Is there a way to get it back? Sincerely yours, Chris

asked Feb 10 by Napoleon (4.9k points)
0 votes
1 answer

I am using external powershell scripts where adaxes custom attributes are used as inputs. I want to clear/modify those attributes after my external ps1 script gets executed ... the same inside my external scripts thru try{}catch{} error handling method?

asked Mar 19, 2016 by Brajesh (2.5k points)
2,294 questions
2,050 answers
5,586 comments
58,869 users