get-adobject and export-csv

Topics: User Forum
May 18, 2007 at 3:07 PM
Hi All,

I'm having problems using get-adobject to get a CSV of a few particular attributes. I want a CSV of the name, sAMAccountName and employeeID attributes of all non-disabled user accounts:

get-adobject -class user | where-object {$_.userAccountControl -ne 514} | select-object name, sAMAccountName, employeeID | export-csv -path out.csv

In the CSV, I get a bunch of lines like this:


Any way I can get the actual values here? If I don't export it, the format on the screen has the values.


May 18, 2007 at 4:01 PM
This should solve your problem:

get-adobject -class user | where-object {$_.userAccountControl -ne 514} | select-object {$}, {$_.sAMAccountName}, {$_.employeeID} | export-csv -path out.csv 

You can find more info at
May 18, 2007 at 4:21 PM
Excellent! Thanks!