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?
 
timgreen7077Connect With a Mentor Exchange 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
 
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 NelsonConnect With a Mentor Systems 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.