Get Exchange mailbox sizes for users with a specfic email address (Powershell- Exchange 2007)

Hi guy i'm trying to generate a report and need a powershell command to get all the users with a specific domain only. and i need the size of the mailbox in KB. Any ideas

Thanks
Raymond BrooksAsked:
Who is Participating?
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.

Raymond BrooksAuthor Commented:
unfortunately that does help me pick out only the users i need
0
RantCanSr. Systems AdministratorCommented:
If you have a specific list of names, you can list them in to pull stats using the same command.

Script is posted here:

https://social.technet.microsoft.com/forums/exchange/en-US/b015e509-539e-4104-93c9-bee258fb6b97/get-mailboxstatistics-from-a-csv-file

User needs to pull from a CSV specific users and return stats.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Raymond BrooksAuthor Commented:
Well this turned out to be a two part exercise:

First i had to get all the users with this command:
Get-Mailbox -resultsize unlimited | Select-Object displayname -expandproperty emailaddresses| Where-Object {$_.smtpaddress -like "*child.domain.com*"}| Select-Object displayName,SmtpAddress,identity,servername | Exprot-CSV "c:\temp\childexport.csv"

Then run this command, which imports the users from the previous csv (found on this site http://memphistech.net/?p=241).

Import-Csv “c:\temp\childexport.csv” | ForEach-Object -Process {Get-Mailbox $_.Name | Select-Object name,@{n=”Size(MB)”;e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize.value.toMB()}},@{n=”DeletedSize(MB)”;e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalDeletedItemsize.value.toMB()}},@{n=”Items”; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount}},@{n=”DeleteItems”; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.deleteditemcount}}} | Export-CSV “c:\userstats.csv” -notype
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
Raymond BrooksAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for rdbrooks's comment #a41100128

for the following reason:

found it myself
0
RantCanSr. Systems AdministratorCommented:
So the link I suggested was no help at all?  It seems like it could have at least a lead or two...
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
Exchange

From novice to tech pro — start learning today.

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.