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

Raymond BrooksAsked:
Who is Participating?

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

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

User needs to pull from a CSV specific users and return stats.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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 "**"}| 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

Import-Csv “c:\temp\childexport.csv” | ForEach-Object -Process {Get-Mailbox $_.Name | Select-Object name,@{n=”Size(MB)”;e = {$MBXstat = Get-MailboxStatistics $; $MBXstat.totalItemsize.value.toMB()}},@{n=”DeletedSize(MB)”;e = {$MBXstat = Get-MailboxStatistics $; $MBXstat.totalDeletedItemsize.value.toMB()}},@{n=”Items”; e = {$MBXstat = Get-MailboxStatistics $ ; $MBXstat.itemcount}},@{n=”DeleteItems”; e = {$MBXstat = Get-MailboxStatistics $ ; $MBXstat.deleteditemcount}}} | Export-CSV “c:\userstats.csv” -notype

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

From novice to tech pro — start learning today.