Export all Mailbox Sizes to CSV using Powershell on Office 365

Set-ExecutionPolicy RemoteSigned
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session
get-mailbox | get-mailboxstatistics | select DisplayName,ItemCount,TotalItemSize | export-csv “MailboxSizes.csv”

Leave a comment

Your email address will not be published. Required fields are marked *

CAPTCHA ImageChange Image