Avatar of hussein-Alrajeh
hussein-Alrajeh
 asked on

What's the cmdlet for exporting mailbox sizes including OU

Dears;

I need a cmdlet with exchange power shell that exports mailboxes size and ProhibitSendQuota for a specified OU in csv file and the result be  organized from the large mailbox size to the small i tried the below command but when i export it to csv file it comes with bad data ( displays the display name just random numbers and characters and everything else is not displayed )

get-mailbox -organizationalunit "precast factory" | get-mailboxstatistics | ft Displa
yName, TotalItemSize, ItemCount | export-csv "c:\report.csv"

so please someone provide me the right cmdlet that meets the above request

Thanks in advance
ExchangeEmail ServersPowershellShell Scripting

Avatar of undefined
Last Comment
hussein-Alrajeh

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
prashanthd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
suriyaehnop

Get-Mailbox -ResultSize Unlimited | where {$_.OrganizationalUnit -eq 'domain\OU'}| Format-Table Displaynamealias,issuewarningquota,prohibitsendquota,prohibitsendreceivequota, @{Label='Size(MB)';expression={$mbx=get-mailboxstatistics -identity $_;$mbx.totalitemsize.value.toMB()}} >c:\GroupMailboxquota_1.csv

Open in new window

hussein-Alrajeh

ASKER
the answer wasn't complete cause no send prohibit or receive on the command
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck