The -Filter parameter takes a string, not a code block, as its argument. Try this:
-Filter "extensionAttribute14 -like '*'"
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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?
The -Filter parameter takes a string, not a code block, as its argument. Try this:
-Filter "extensionAttribute14 -like '*'"
@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
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,
@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
@Rich Matheisen : We dont have the exchange integrated so wont be able to try mailuser cmd. Anything else we can try?