Exporting Powershell to formatted CSV file
hello
running powershell v2. have following command pulls mailbox name , sizes list of users.
when exports csv, data not formatted properly. i'd have display name , mailbox size in seperate columns on csv file doesn't seem possible? when data exported appears in same column?
get-content c:\list.txt | get-mailbox | foreach-object {get-mailboxstatistics -identity $_} | fl displayname, @{ expression={$_.totalitemsize.value.tomb()}} > c:\export.csv
running powershell v2. have following command pulls mailbox name , sizes list of users.
when exports csv, data not formatted properly. i'd have display name , mailbox size in seperate columns on csv file doesn't seem possible? when data exported appears in same column?
get-content c:\list.txt | get-mailbox | foreach-object {get-mailboxstatistics -identity $_} | fl displayname, @{ expression={$_.totalitemsize.value.tomb()}} > c:\export.csv
select displayname, @{ expression={$_.totalitemsize.value.tomb()}} | export-csv c:\export.csv
Windows Server > Windows PowerShell
Comments
Post a Comment