Get-MailboxStatistics -Server 'SERVERNAME' | where {$_.ObjectClass -eq “Mailbox”} | Sort-Object TotalItemSize -Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}} -auto >> “c:\Temp\mailbox_size.txt”# Set the current date$a = get-date
$month= $a.month
$day= $a.day
$year= $a.year# File variables$location = "c:\temp"
$BASE = "mailbox_size.txt"
$filename = $location+"$month"+"-"+"$day"+"-"+"$year"+"-"+$BASE
$oldfile = $Location+$BASE# Rename file for current daterename-item $oldfile $filename
Source: https://social.technet.microsoft.com/Forums/exchange/en-us/56ac5fc7-0115-4506-89fd-30b859301b2b/exchange-powershell-script-to-find-all-users-mailbox-sizes?forum=exchange2010
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.