# powershell to csv getting columns

**URL:** https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073
**Category:** PowerShell Help
**Created:** [February 25, 2019, 7:14am UTC](https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073 "2019-02-25T07:14:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sammemans](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@sammemans](https://forums.powershell.org/u/sammemans)
#### Post date: [February 25, 2019, 7:14am UTC](https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073/1 "2019-02-25T07:14:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)
#### Post date: [February 25, 2019, 7:53am UTC](https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073/2 "2019-02-25T07:53:17Z")

</div>

[https://social.technet.microsoft.com/Forums/en-US/9eb170dd-a3d9-4c87-9e7f-0b11e20a4f22/powershell-to-csv-getting-columns?forum=winserverpowershell](https://social.technet.microsoft.com/Forums/en-US/9eb170dd-a3d9-4c87-9e7f-0b11e20a4f22/powershell-to-csv-getting-columns?forum=winserverpowershell)

What’s wrong with the answeres you’ve got there? You didn’t even replied to them.

---

<div class="post-metadata">

### Author: ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)
#### Post date: [February 25, 2019, 1:33pm UTC](https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073/3 "2019-02-25T13:33:37Z")

</div>

The export cmdlet send raw data to a file, they do not format them for you.

That Export-Csv cmdlet, by default send the data in a column format, but it will not show as a table in a text or other file reader.  
What you will seem is a flat file, with double quotes and common separated. This is basic PS intro level stuff.

You can see the table / column format by simply using the Import-Csv cmdlet and see the auto-formatted table on your screen. It’s the PS automatic formatters that is doing this for screen only display, and it will not do that for output. You need to do that, yourself in code or sending to screen and clip from there to paste in a file, .txt, Word, etc.

**Being new to PS is fine, but it is vital that you expend the effort to get up to speed on it**. Using all the no-cost / free video …

> https://www.youtube.com/results?search\_query=beginning+powershell https://www.youtube.com/results?search\_query=beginning+export+formatting+powershell

…and eBook resource available all over the web. Even on this site, **just click the ‘Free Resources’ link in the left navigation pane** _or see these Q & A’s._

 

_> https://www.reddit.com/r/PowerShell/comments/ar6cvt/powershell\_in\_depth\_second\_edition/egmlpom/?context=3 https://www.reddit.com/r/PowerShell/comments/afqmmw/i\_want\_to\_help\_my\_husband\_advance\_his\_powershell/ee3k6p6/?context=3_

 

_And this…_

 

_> https://docs.microsoft.com/en-us/powershell https://blogs.msmvps.com/richardsiddaway/2019/02/21/the-source-of-powershell-cmdlets_

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 8:33pm UTC](https://forums.powershell.org/t/powershell-to-csv-getting-columns/12073/4 "2024-05-16T20:33:22Z")

</div>


