Count Folders in Exchange Online / Office 365 Mailbox

article #1355, updated 1552 days ago

To count the total number of folders in use within a mailbox, first connect Powershell to Exchange Online, then:

$MailboxToCountFoldersWithin = Get-Mailbox username
$MailboxToCountFoldersWithin | Get-MailboxFolderStatistics | Measure-Object | Select-Object -ExpandProperty Count

The total number of folders, will be output as a number.