22. August 2013 · Comments Off on Check mailbox size and usage with Office 365 · Categories: Office365 · Tags: , ,
  1. First of all, you need to use the regular version of PowerShell.  NOT the “Online Services Module” for PowerShell version
  2. Make sure you run PowerShell as an administrator. (Right-click the icon and select “Run as Administrator”)
  3. The first time I ever tried to run these type of scripts, I got an error about running remote signed scripts or something like that. So you need to run this command the very first time you try any operations like this:
    • Set-ExecutionPolicy RemoteSigned
  4. Next are the 3 commands that you need to run to connect to your hosted Exchange server and start a new session:
    • $LiveCred = Get-Credential (then enter your Office 365 email address and password 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
  5. Next is the basic command to get a list of all users and their current mailbox size:
    • get-mailbox | get-mailboxstatistics | ft displayname, totalitemsize
  6. When you are finished, it’s a best practice to go ahead and close your session before you exit PowerShell, so you need to run this command:
    • Remove-PSSession $Session

Comments closed.