hi,

I want my output of AD users to populate specified columns in a CSV instead of listing all output under the 1st column.

my code:

BREAK ON
$domain = GetObject("LDAP://ou=blah,dc=blah,dc=blah,dc=blah") ;Connect to AD
IF NOT $domain = 0 ;Confirm connection
$nul=RedirectOutput("c:\export.csv",0) ;Output to CSV
"Department,Name,Surname,First Name,Email Address, Description" ;6 Columns set in CSV
For Each $user in $domain
? $user.department ? $user.givenname ? $user.sn ? $user.name ? $user.mail ? $user.description
;end of script

I've tried a few things but nothing to give me the result i require. I know there must be a simple way of doing this but i'm starting to go round in circles here
thanks