Hello,
I am searching for a PowerShell script that will return the value of extension attribute 9 in a specific OU in active Directory. Could someone assist me with this?
Thanks!
Hello,
I am searching for a PowerShell script that will return the value of extension attribute 9 in a specific OU in active Directory. Could someone assist me with this?
Thanks!
Hi @Ozz-4746 ,
please try this:
$ou = "OU=Whatever,DC=MYDomain,DC=local"
Get-ADUser -Filter * -SearchBase $ou -Properties extensionattribute9 | Select-Object -ExpandProperty extensionattribute9
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
This is brilliant it outputs the licenses for all users in the OU. You are super! Thank you very much. I have one more request, is it possible to add a line of code so that it also outputs the display name next to the license aswell?
That would be perfect!
Hi @Ozz-4746 ,
are you talking about the extensionattribute9 of AD users in a specific OU in your domain?
Than may this helps to get started (not tested by myself):
$ou = "OU=Whatever,DC=MYDomain,DC=local"
Get-ADUser -SearchBase $ou -Properties extensionattribute9
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten
Hi Andreas,
I've tried your script but I get the error
Message: 'Operator Not supported: =' at position: '5'.
At line:1 char:2
+ Get-ADUser -SearchBase $ou -Properties extensionattribute9
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Get-ADUser], ADFilterParsingException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADFilterParsingException,Micr
osoft.ActiveDirectory.Management.Commands.GetADUser
$ou = "OU=Users,OU=XXX,OU=XXXX,DC=XXX,DC=AXXX,DC=XXX"
Get-ADUser -SearchBase $ou -Properties extensionattribute9
10 people are following this question.
How to get multiple user mS-DS-ConsistencyGuid GUID in hexa format
Issues running on-prem AD Powershell module from an Azure AD joined device.
EmployeeType AD Attribute is an Invalid Filter syntax when creating New-DynamicDistributionGroup
Can't find user info in AzureAD
Output extension9 and Name for all users in specified OU in AD via powershell script