abustraan
asked on
Exchange 2013 Mailbox Size in GB with 2 decimals Export to CSV via Exchange PowerShell
I have this code:
And it runs great with the exception I can't seem to get the output to GB with 2 decimals. I've tried merging parts and pieces, trying to keep it a simple script without a bunch of variables...
set-executionpolicy RemoteSigned
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
(Get-MailboxDatabase | get-mailboxstatistics | Sort-object totalitemsize -descending | select-object displayname, itemcount, @{ expression={$_.TotalItemSize.Value.ToGB()} } | convertto-csv | out-file "E:\Exports\$(get-date -format yyyy-MM-dd_hhmmss)_MBSize.csv")
And it runs great with the exception I can't seem to get the output to GB with 2 decimals. I've tried merging parts and pieces, trying to keep it a simple script without a bunch of variables...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your don't write | convertto-csv | out-file, it's just | export-csv