Unable to get extension attribute values

Arun Velusamy 21 Reputation points
2021-09-15T14:19:17.627+00:00

Hello

I want to export all extensionattribute values for all users in AD. I tried multiple ways but the extensionattribute values are returning with empty data even though it has values. Tried below cmds:

Get-ADUser -Filter * -Properties * | select extensionAttribute*

Get-ADUser -Properties 'extensionAttribute14' -Filter * | fl sAMAccountName, extensionAttribute14

Get-ADUser -Properties 'extensionAttribute14' -filter {extensionAttribute14 -like '*'} | Select-Object extensionAttribute14

Get-ADUser -Properties 'extensionAttribute*' -Filter * | fl sAMAccountName, extensionAttribute*

Output comes like below:

Name : xxxxx
extensionAttribute1 :
extensionAttribute2 :
extensionAttribute3 :
extensionAttribute4 :
extensionAttribute5 :
extensionAttribute6 :
extensionAttribute7 :
extensionAttribute8 :
extensionAttribute9 :
extensionAttribute10 :
extensionAttribute11 :
extensionAttribute12 :
extensionAttribute13 :
extensionAttribute14 :
extensionAttribute15 :

I went through almost all the articles but non gave the result. Am I missing something here? Can you please suggest a way to get it?

Windows for business Windows Client for IT Pros Directory services Active Directory
Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2021-09-15T14:31:57.433+00:00

    The -Filter parameter takes a string, not a code block, as its argument. Try this:

    -Filter "extensionAttribute14 -like '*'"
    
    0 comments No comments

  2. Arun Velusamy 21 Reputation points
    2021-09-15T14:41:38.7+00:00

    @Rich Matheisen : Tried this but didnt work, it didnt even display samaccountname

    Get-ADUser -Filter "extensionAttribute14 -like '*'" -Properties 'extensionAttribute14' | Select samaccountname, extensionAttribute14

    Get-ADUser -Filter "extensionAttribute14 -like '*'" -Properties extensionAttribute14 | Select samaccountname, extensionAttribute14

    132380-image.png


  3. Limitless Technology 39,916 Reputation points
    2021-09-16T07:46:51.143+00:00

    Hello Arun V,

    Normally I use this format for my input, can you try?

    Get-ADUser -Properties extensionAttribute1 -Filter * | Select sAMAccountName, extensionAttribute1 | export-csv c:\temp\extensionattribute1.csv

    Hope this works for you too,
    Best regards,

    0 comments No comments

  4. Arun Velusamy 21 Reputation points
    2021-09-16T13:19:43.237+00:00

    @Limitless Technology , I tried this but still giving empty values for extensionattribute, able to get the samaccountname though. Any further thoughts?

    Get-ADUser -Properties extensionAttribute1 -Filter * | Select sAMAccountName, extensionAttribute1 | export-csv c:\temp\extensionattribute1.csv

    0 comments No comments

  5. Arun Velusamy 21 Reputation points
    2021-09-16T13:21:14.007+00:00

    @Rich Matheisen : We dont have the exchange integrated so wont be able to try mailuser cmd. Anything else we can try?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.