question

ArunVelusamy-4455 avatar image
0 Votes"
ArunVelusamy-4455 asked LimitlessTechnology-2700 answered

Unable to get extension attribute values

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-serverwindows-server-powershellwindows-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered RichMatheisen-8856 edited

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

 -Filter "extensionAttribute14 -like '*'"


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArunVelusamy-4455 avatar image
0 Votes"
ArunVelusamy-4455 answered RichMatheisen-8856 commented

@RichMatheisen-8856 : 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



image.png (41.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Unfortunately my AD directory schema hasn't been extended to include any of the Exchange attributes, so I'm unable to work with the property you're trying to use.

However, if you select just one user that you know to contain a populated extensionAttribute14 property using Get-ADUser and requesting "-Properties *", do you find that property in the results?

0 Votes 0 ·

Can you use the Exchange "Get-MailUser" cmdlet and do the selection in a Where-Object cmdlet?

0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArunVelusamy-4455 avatar image
0 Votes"
ArunVelusamy-4455 answered

@LimitlessTechnology-2700 , 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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ArunVelusamy-4455 avatar image
0 Votes"
ArunVelusamy-4455 answered RichMatheisen-8856 edited

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

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Okay, but I made two comments and you only remarked on the last one.

The first one asked this:

However, if you select just one user that you know to contain a populated extensionAttribute14 property using Get-ADUser and requesting "-Properties *", do you find that property in the results?

0 Votes 0 ·
ArunVelusamy-4455 avatar image ArunVelusamy-4455 RichMatheisen-8856 ·

I tried for single user who has this extensionAttribute14 value but still returns with empty when i run the Get-aduser -properties * - which is very strange

0 Votes 0 ·
RichMatheisen-8856 avatar image RichMatheisen-8856 ArunVelusamy-4455 ·

But is the PROPERTY NAME in the results, regardless of its having a value?

If you run the test in a PowerShell session that's "Run as administrator" do the results differ?

You previously said "We dont have the exchange integrated" -- does that mean that you've extended the AD schema to include all the additional properties that Exchange introduces? If not, have you manually extended the schema to include properties that you've named "extensionAttribute14" etc.?


0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello,

Additionally ,
Please try below Powershell cmd to get all values of AD user then you can export to .csv and filter them from Excel.

Get-AdUser -Properties -filter | select * | FT

Hope this help,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.