Extract mailbox statistics based on Exchange Group and also Office Location.

Hi,

I am trying to run a Powershell script across our on premise Exchange 2010 to extract:

Extract 1. Users mailbox size, message count initially for a specific Exchange Group
Extract 2. Users mailbox size, message count initially for a specific users location (Information is kept in AD under their office field)

I was trying the below:
Get-Mailbox -resultsize unlimited | select @{Name="User Name";expression={$_.displayname}},@{Name="Department";expression={(get-user $_.alias).department}},@{Name="Storage Group"; expression={$_.database}}, @{Name="Total Size (MB)";expression={(get-mailboxstatistics $_).totalitemsize.value.toMB()}} | Export-Csv c:\Export.csv

And then I was going to manipulate this in Excel, but this is not gettting me the results I am after.

Any guidance would be great.

Thanks
Snappa2000Asked:
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.

timgreen7077Exchange EngineerCommented:
See the below link from a previous question I answered that was similar to yours. This should get all the info you need.

https://www.experts-exchange.com/questions/29084115/Exporting-mailbox-information-to-CSV-for-one-particular-domain-or-one-OU.html
0

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
Snappa2000Author Commented:
Thanks, that's in reference to a specific OU.  I was after a Exchange/Security group and then a different extract based on the Office location
Cheers
0
Todd NelsonSystems EngineerCommented:
Would these work for you?

Extract 1. Users mailbox size, message count initially for a specific Exchange Group

Get-DistributionGroupMember -Identity "IT Department" | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | select DisplayName, TotalItemSize, ItemCount | Export-Csv -NoTypeInformation C:\Export.csv

Open in new window



Extract 2. Users mailbox size, message count initially for a specific users location (Information is kept in AD under their office field

Get-Mailbox -ResultSize Unlimited | where { $_.Office -like "Alaska" } | Get-MailboxStatistics | select DisplayName, TotalItemSize, ItemCount | Export-Csv -NoTypeInformation C:\Export.csv

Open in new window

0
Snappa2000Author Commented:
Perfect!!! Couldn't of asked for a better response.  Thanks
0
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.