Jan 9, 2013

Check mailbox size and usage with Office 365 or Exchange online. Find users nearing their quota.

The other day I wanted to have a look at the mailbox usage for one of my Office 365 clients.  I wanted to see all 35 users and find out if anyone was close to their mailbox quotas.  There is no way to check this for all users at once using the Office 365 or Exchange Online GUI so you need to turn to PowerShell.  I had to go to 5 or 6 different sites to find all of the little details and troubleshoot some errors so I thought I'd compile all of that info into a blog post for you.

  1. First of all, you need to use the regular version of PowerShell.  NOT the "Online Services Module" for PowerShell version that you would typically use for other Office 365 tasks, I guess because we are talking directly to the Exchange environment here and not the Office 365 portal itself. 
  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
These steps should get you connected and give you a quick look at user mailbox sizes so you can see if anyone is in danger of hitting their quota.  There are a ton of other scripts that can give you all sorts of information about the hosted Exchange environment.  I even some scripts that would actually create a local Excel spreadsheet and pipe the output to that file so you could save it or analyze it further. I'll try to post more of this type of stuff in the future.

33 comments:

Anonymous said...

Great post.
I was always intimidated from PS.
Not anymore.
t y v m.

Love SMS said...

Hi, from last 6 yrs i am working on free OS's (Linux/Unix) which are free and also provides free S/W as well, hence I am interested only in free S/W as well as OS. In these 6 yrs i even not worked on any windows/Microsoft flavours even at home

Anonymous said...

Thanks So Much for this made my life so easier thanks

Dom said...

Thanks for this - now I need to go and find all the other PS commands for things like increasing mailbox size!

Anonymous said...

Thanks

Anonymous said...

you are saved my time :) Thanks

Anonymous said...

Excellent guide, thank you. Started looking through your other posts.

Anonymous said...

Very Helpful Article ... Thanks a lot

Anonymous said...

Thanks for the article.

What command so i use if i want to generate a report of all users with a 5gb mailbox or over?

Thanks,

Anonymous said...

I just found & tried this, but it gave me my local Exchange stats - not the Exchange Online that I was looking for (and authenticated with in an early PowerShell step).

Is it because I was using an admin workstation that has my Outlook accounts, plus Exchange Management Console & Exchange Management Shell also installed (but not open)?

Binh said...

Thank you very much for taking the time to research this up then posting the command. This was very helpful because I needed to track the size of a mailbox for a client of mine!

Thanks,
Binh

JRS - NE Florida said...

Very helpful, exactly what I needed.

Ferguso said...

a given article is very interesting and very useful for me, thank you very much and sorry I consent to share the article here Cara menyembuhkan malaria

ASO Services said...

Hi dear, I like your post so much, and it is very good. Hope that we can communicate with each other. I want to introduce an what is aso, I try it and I feel it is so good to us beginners.

Nuy Keroppi 910 said...

may be useful for all, helpful article once and pardon me permission to share also here

Obat radang telinga
Obat radang sendi
Cara menyembuhkan maag kronis

Hermawan Alfaqih said...

I am very glad to be one of the readers of this article you create. Thank you for sharing and I hope this website you manage to be the best Obat Kista

Foogle Packers and Movers said...

Thank you for your information the verified and trusted post article visit along time Safe & Reliable services.

foogle packers
packers movers pune
packers movers noida
packers movers gurgaon
packers movers bangalore

Foogle Packers and Movers said...

Thank for more information the post article find for economical and Reliable Shift Solution for me satisfy customer's demands.

foogle packers and movers
packers movers delhi
packers movers mumbai
packers movers hyderabad
packers movers chennai

Cheapest Packers India said...

Thanks for your information the quality of link is fine Very wonderful your article and review visit # Cheapest Packers

packers and movers in Delhi
packers and movers in Noida
packers and movers in Faridabad
packers and movers in Ghaziabad
packers and movers in Guwahati

Unknown said...


I must say you had done a tremendous job,I appreciate all your efforts.
Thanks alot for your writings.
Waiting for a new 1...Please visit our wonderful and valuable website-
For More Details Visit are Official Websites :
Jakarta escort service
https://gedheanune.blogspot.com
http://murdock44.angelfire.com/
FILM BOKEP TERBARU
NONTON FILM BOKEP
http://inempkr.tk
http://pkrhok88.tk
http://tglhok88.tk

Anonymous said...

Thanks for the helpful information. Because, I just found out there is a very extraordinary article like this, thanks

Toko Obat Herbal
Obat pereda Nyeri Sendi
Cara merawat kesehatan jantung
Cara menambah HB darah
Cara Menghilangkan Milia

Unknown said...

This looks SO good! My mother-in-law makes something that looks/sounds just like this, and it is my favorite dessert she makes.
obat lipoma
obat darah kental
obat polip hidung
obat cantengan
obat benjolan di kepala
obat kelenjar getah bening

Cara menyembuhkan impetigo said...

given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :

Obat susah kencing
Obat susah kencing
Obat susah kencing
Obat angin duduk
Obat epilepsi
Obat kejang
Obat pengapuran tulang

nhuthuy said...

Thanks for sharing, nice post! Post really provice useful information!

Giaonhan247 chuyên hướng dẫn cách mua hàng trên amazon ship về việt nam cũng như hướng dẫn tự mua hàng trên amazon ship về Việt Nam uy tín, và kinh nghiệm mua hàng trên amazon cũng như cách tính thuế khi mua hàng trên amazon giá rẻ.

AAAAAAAA said...

kyrie irving shoes
michael kors outlet
kate spade handbags
michael kors outlet online
longchamp outlet
chrome hearts online
paul george shoes
nike shoes for men
nike air force
balenciaga sneakers

FauziUzi said...

Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for
obat penyakit granuloma annulare
cara menyembuhkan batuk berdahak

nhuthuy said...
This comment has been removed by the author.
QQQQQQQQQ said...

golden goose sneakers
nike react
goyard bags
vans shoes
ray ban sunglasses
yeezy boost 350
fila shoes
chrome hearts
michael kors
nike epic react

jjjjjjjjjjjjj said...

lacoste polo shirts
michael kors outlet store
golden goose
chrome hearts
air jordan 6
links of london
adidas shoes for men
nike hyperdunk
adidas shoes
jordan retro

Unknown said...

20181031 leilei3915
malone souliers shoes
ralph lauren shirts
canada goose jackets
christian louboutin sale
soccer cleats
michael kors outlet clearance
cheap ugg boots
ugg boots
moncler coats
ugg boots clearance

Lutfi Kurniawan said...

Permission to share information about herbal treatment

Biaya Operasi Benjolan Di Leher Akibat Kelenjar Getah Bening
Cara Mengatasi Nyeri Ulu Hati Dan Perut Kembung
Cara Menghilangkan Gatal Dan Benjolan Bernanah Pada Kulit
Bahaya Benjolan Di Leher Dan Cara Menghilangkannya
Manfaat Qnc Jelly Gamat Untuk Kesehatan

jjjjjjjjjjjjj said...

golden goose francy
irving shoes
yeezy shoes
louboutin shoes
cheap nhl jerseys
coach outlet stores
nike flyknit trainer
nike air max 90
adidas stan smith
kd 10

Lutfi Kurniawan said...

Great post, really inspiring Cara Mengobati Kaligata Cara Mengatasi Asma Cara Mengatasi Hidronefrosis

Autopilot White Glove error message We couldn't find any Provisioning Packages

I was testing out the Windows Autopilot "White Glove" feature this week.  This is a new feature of the Intune AutoPilot service th...