I need to export mailbox Size and Archive size to the same csv file.
I know to export the mailbox size I need to use Get-Mailbox | Get-MailboxStatistics | select-object Displayname,totalitemsize | export-csv .\filename.csv
to get archive size I need to use Get-Mailbox | Get-MailboxStatistics -archive | select-object totalitemsize | export-csv .\filename.csv
I need to know how to marge between this two commands.
Thank in advance.
Avraham.
Best Answer
I think a hash table it what you're after
https://technet.microsoft.com/en-us/library/ee692803.aspx
http://blogs.technet.com/b/heyscriptingguy/archive/2011/10/15/automatically-create-a-powershell-hash-table-10-15-11.aspx
Basically you define a table, eg: MailboxName, ActiveSize, ArchiveSize
Create a loop, get $This value from $There . $That from $Here
Rinse and repeat
Edit: I haven't tested this, but should give the basic idea