exchange; mailbox; folders; powershell

All posts tagged exchange; mailbox; folders; powershell

$Mailboxes = Get-Mailbox -id  Deborah_Polen-Pitman
$Results = foreach( $Mailbox in $Mailboxes ){
    $Folders = $MailBox |
        Get-MailboxFolderStatistics |
        Measure-Object |
        Select-Object -ExpandProperty Count

    New-Object -TypeName PSCustomObject -Property @{
        Username    = $Mailbox.Alias
        FolderCount = $Folders
        }
    }

$Results |
    Select-Object -Property Username, FolderCount