Q: CSV export ExtensionAttributes with values Trying to export list of AD Users and Extension Attributes but only export a column if there is a value for at least one user. For onscreen results I have this working but when I export to csv, it only gives me one column for extensionattribute5 which is the one that most people have a value for. There are a number of other extension attributes that some users have values for but not all 15 extension attributes have values. I only want it to export columns that have a value, the same as it does in the screen output before I try and send it to CSV. I know I can select all 15 of them by explicitly entering each one but I am hoping to only have it export all of those extension attributes columns that have at least one value. 
Below is how it is displayed on screen if using select extensionattibute* but the exported CSV only returns the particular extension attribute that most users have a value for, i.e. it has only one column for extensionattibute5
User1
name
mail
extensionAttribute*
User2
name
mail
extensionAttribute2
extensionAttribute6 
This is my current command: 
get-aduser -filter * -SearchBase 'OU=Users,OU=division,DC=org,DC=company,DC=place,DC=us' -properties * |  select name,mail,extensionAttribute*,userprincipalname, @{name="proxyaddresses";expression={($_.proxyaddresses | Where-Object {$_ -like "*smtp:*"}) -join ","}} |  Export-Csv c:\temp\myfile.csv -notypeinformation  -Encoding UTF8

