locked
powershell to csv getting columns RRS feed

  • Question

  • Hi all,

    For my internship I need to write a script. My script is: Get-ADUser -Filter * -Properties * | select Name,whenCreated, Description, whenchanged, Lastlogondate, LastBadPasswordAttempt, BadlogonCount, LockedOut, Enabled |export-csv c:\informatie-user-csv.csv.

    how can I get all these properties in a different columns in my csv-file?

    Greetings

    Sam

    Thursday, February 21, 2019 1:24 PM

All replies

  • Please format your code as code here in the forum using the code posting tool provided on the edit bar of the post editor.

    All these properties are in different columns. Why do you think it is not this way?

    What's your

    Get-Culture
    ?


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''



    • Edited by BOfH-666 Thursday, February 21, 2019 3:19 PM
    Thursday, February 21, 2019 1:39 PM
  • help export-csv -online
    help select-object -online

    This will give you a full explanation of the code.

    If you just copy code without understanding it will not help your internship.  An internship is to test you to see if you can figure out the simple things.  Asking others to give you the answer doesn't help.

    Start by studying PowerShell.  There are many books and tutorials available.  That is what they want you to do.  They don't want you to ask others to do your work for you.


    \_(ツ)_/

    Thursday, February 21, 2019 1:41 PM
  • Hi,
    Was your issue resolved? 
    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.
    Best Regards,
    Lee

    Just do it.

    Friday, February 22, 2019 8:55 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee


    Just do it.

    Monday, February 25, 2019 6:59 AM