I am using the following command:
get-aduser $user -Properties LastLogonDate | select sAMAccountName, DistinguishedName, LastLogonDate | Format-Table -HideTableHeaders | out-file '.\01-test.txt'
I am getting the information I am looking for, just not all of it. The table columns are padded - truncated to 39 characters (40 if you count 0 :-))
Cross-Daphne CN=Cross\, Daphne,OU=Users,OU=FM,OU=... 11/7/2013 7:53:00 AM
I tried replacing the | Format-Table -HideTableHeaders with | Export-CSV and ended up with a zero byte file
I would like to have the complete distinguishedName in either table or csv format.
I hope this makes sense.