Exchange 2013 user mailbox usage

Hi, Is it possible to export users in a OU with following information:-
1) Username
2) DATABASE
3) User Mailbox quota
4) Current user mailbox usage

Thank you.
TJOSYAsked:
Who is Participating?

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

x
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.

MASEE Solution Guide - Technical Dept HeadCommented:
Please check this it may help. Download the script and try
https://gallery.technet.microsoft.com/exchange/Email-statistics-including-e9cb1b26
TJOSYAuthor Commented:
@MAS: TY..I don't see this script will help to get the information exported to CSV
MASEE Solution Guide - Technical Dept HeadCommented:
Please check the article completely
The second script will export to CSV
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

TJOSYAuthor Commented:
its in table format not csv
Vaseem MohammedCommented:
Hope this will work for you.
Get-Mailbox -RecipientTypeDetails UserMailbox | select samAccountname, database, usedatabasequotadefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,@{N="Mailbox Usage";E={Get-MailboxStatistics -Identity $_ | select -ExpandProperty totalitemsize}} | Export-Csv c:\Attachments\test.csv -NoTypeInformation

Open in new window

If you want more information for the user, use get-mailbox username | fl and see which property you want to include and punch it in the select statement.
TJOSYAuthor Commented:
@Vaseem: its ok, once we add "-path" after "Export-Csv"
Export-Csv -path c:\Attachments\test.csv -NoTypeInformation.

Full script:
Get-Mailbox -RecipientTypeDetails UserMailbox | select samAccountname, database, usedatabasequotadefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,@{N="Mailbox Usage";E={Get-MailboxStatistics -Identity $_ | select -ExpandProperty totalitemsize}} | Export-Csv -path c:\Attachments\test.csv -NoTypeInformation

Again, this have two issues:-
1) it doesn't give me user more than 1000 users
2) this script cannot export information for specific AD OU.

Please help.
Vaseem MohammedCommented:
Try this.
Get-Mailbox -ResultSize Unlimited -OrganizationalUnit "ou=OUName,dc=domain,dc=com" -RecipientTypeDetails UserMailbox | select samAccountname, database, usedatabasequotadefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,@{N="Mailbox Usage";E={Get-MailboxStatistics -Identity $_ | select -ExpandProperty totalitemsize}} | Export-Csv -path c:\Attachments\test.csv -NoTypeInformation

Open in new window

To get the exact DN of OU, go to ADUC and 1st make sure Advanced Features is enabled.
Adv featuresGo to the Targetted OU Properties windows, Attribute Editor, Select the DN and View. Copy the DN and paste it in your script.
DN

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
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
Powershell

From novice to tech pro — start learning today.