SELECT DisplayName,FolderType,ItemsInFolder,FolderSize


FROM OpenExchangePSQuery(


           POWERSHELL, '


$Mailboxes = Get-Mailbox -ResultSize Unlimited


Foreach ($M in $Mailboxes)

{


$DisplayName = $M.Displayname


$Statistics = Get-MailboxFolderStatistics -Identity $DisplayName -FolderScope Outbox


$Result = New-Object PSObject -Property @{

DisplayName = $DisplayName

FolderType = $Statistics.foldertype

ItemsInFolder = $Statistics.ItemsInFolder

FolderSize = $Statistics.foldersize

}


$Result | Select DisplayName,FolderType,ItemsInFolder,FolderSize



}


              ', POWERSHELL

)