打开EMS
第一步,导出现有邮箱的实际大小
$mailboxreport = Get-MailboxDatabase | get-mailboxstatistics | sort-object -property totalitemsize -descending
第二步,将需要的列导出到CSV
$mailboxreport | select-object displayname, itemcount, @{ expression={$_.TotalItemSize.Value.ToKB()} } , lastloggedonuser, lastlogontime, lastlogofftime, servername, databasename | export-csv c:\userstats.csv