none
Unable to read csv file RRS feed

Answers

  • Hi,

    Since you want to export the result to a CSV file, why not just use select.

    And in additon, based on my understanding, format commands are used to format outputs when your want to list all of them on the screen.

    So please try the below code:

    Get-ADUser -Filter * -Properties "LastLogonDate" |

    sort-object -property lastlogondate -descending |

    select name, lastlogondate -AutoSize |

    Export-csv aduser.csv


    Regards,

    Yan Li


    Yan Li

    TechNet Community Support

    Thursday, May 17, 2012 2:39 AM
    Moderator

All replies