List number of folders in Office 365 mailbox


Is there a way to list/export the folders a users has in their Office 365 (Plan E3) mailbox? If possible to CSV so I can then open in Excel.

LVL 13
Mark GalvinManaging Director / Principal ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Manikandan NarayanswamySecurity Specialist & IBM Security GuardiumCommented:

Well you can export an mailbox in pst format. However if you want export on CSV only the folder which you select will be exported not the subfolders in CSV mode.

Refer the below link

Nadav SolomonCommented:
if you just want the names:
Get-MailboxFolder -Identity user@identity -Recurse |export-csv -path "c:\path\filename.csv"
Mark GalvinManaging Director / Principal ConsultantAuthor Commented:

i don’t want the mailbox data - don’t need to export to PST.

What I want to do is to be able to list, in Excel, all the folders a particular user has in their mailbox and if possible the item count and size of that folder. I’m trying to prove a point to an internal manager that one of their users, who is having performance issues with their Outlook, is down to the fact that the user is 'suffering' from 'many folders for filling emails'. The user is so organized its insane. I reckon they have well over 10,000 folders for a 12GB mailbox. Their Manager, using the same platform to access has a large mailbox but less folders and the manager doesn’t have performance issues.

I want to be open to present both of their mailboxes in the Excel file showing that having too many folders is the reason why the user is having performance issues.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Mark GalvinManaging Director / Principal ConsultantAuthor Commented:

Tried that and getting:
Nadav SolomonCommented:
for folder statistics check out :
Get-MailboxFolderStatistics -Identity user@domain |export-csv -path "c:\path\file.csv"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nadav SolomonCommented:
try it on your mailbox, for other mailboxes its a matter of permissions...
Nadav SolomonCommented:
by the way to get all mailboxes use:
get-mailbox | Get-MailboxFolderStatistics |export-csv -Path C:\TEMP\test.csv
it'll be lots of data :P
Mark GalvinManaging Director / Principal ConsultantAuthor Commented:
Gave me just what I needed. Thanks!
Nadav SolomonCommented:
Glad to help :D thanks for your feedback.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Office 365

From novice to tech pro — start learning today.