Format-Table and Format-List output a different object type.
If you are using export-csv you should use Select-Object instead of fromat-table
Brandon Shell
---------------
Blog:
http://www.bsonposh.com/
PSH Scripts Project:
www.codeplex.com/psobject
I> Im trying to export a list of users in an OU. However, with my script
I> below:
I>
I> get-QADUser -SearchRoot 'ou=sales,OU=state,DC=domain,DC=net' | ft
I> firstname,sn,displayname,mail,physicaldeliveryofficename | export-csv
I> c:\scripts\Sales_Users.csv
I>
I> This is what is contained in the CSV:
I>
I> #TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData
I>
I> ClassId2e4f51ef21dd47e99d3c952918aff9cd,pageHeaderEntry,pageFooterEnt
I> ry,autosizeInfo,shapeInfo,groupingEntry
I>
I> 033ecb2bc07a4d43b5ef94ed5a35d280,,,,Microsoft.PowerShell.Commands.Int
I> ernal.Format.TableHeaderInfo,
I>
I> 9e210fe47d09416682b841769c78b8a3,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> 27c87ef9bbda4f709f6b4002fa4af63c,,,,,
I>
I> and on and on>>>
I>
I> I even tried a " | Out-File sales.csv " -but received the same
I> results. The command w/out the export on screen is perfect, so what
I> am I doing wrong to export these?
I>