Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Processing an array returned by Get-ADuser into CSV

$
0
0

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?


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>