To export a list of user mailboxes from Exchange 2007 to a CSV file, use the following command in the Exchange Management Shell:

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},ItemCount | export-csv C:ExchangeMailboxSize.csv