When performing this task make sure you are using the standard Windows Powershell, not the Microsoft Online Services Module version.  This article assumes you are already familiar with Windows Powershell

Step 1

Open Windows Powershell as Administrator

Step 2

Enter the following commands in to the Powershell Command Prompt

Set-ExecutionPolicy RemoteSigned (only needs to be run the first time you do this)

$LiveCred = Get-Credential (Enter your Office 365 Administrator Credentials in the box that pops up)

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

Import-PSSession $Session

get-mailbox | get-mailboxstatistics | ft displayname, totalitemsize

Step 3

When finished enter the following command to close the session

Remove-PSSession $Session