I am trying to export specific attributes of all users in a specific OU. One of the attributes is being stored as an array of decimal values so when I do a:
Get-ADuser -Filter * -SearchBase "OU=test,OU=org,DC=blah,DC=blah" -Properties sAMAccountName, array_attribute | Select sAMAccountName, array_attribute | export-csv myfile.csv
It results in the CSV file containing Microsoft.ActiveDirectory.Management.ADPropertyValueCollection under the array_attribute column, because export-csv cannot handle arrays.
I need to be able to import the result of Get-ADuser into Excel so, does anyone know of a way to accomplish this?