Solved

Collect mailbox statistics issue.

Posted on 2016-08-22
7
48 Views
Last Modified: 2016-09-14
I need to collect the below info in my Exchange 2010 server: firstname, lastname, loginname/UPN, itemcount, totalitemsize, storagelimitstatus, databasename, mailbox server.  I have tried this command but not able to make it to work:

get-mailboxstatistics -server myexchangeserver | sort-object totalitemsize -descending | ft firstname,lastname,.......

Please advise.  

Thanks,
0
Comment
Question by:nav2567
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 41

Assisted Solution

by:Vasil Michev (MVP)
Vasil Michev (MVP) earned 200 total points (awarded by participants)
ID: 41765559
There is no firstname/lastname/UPN parameter for the get-mailboxstatistics output, you have to get them from a calculated property or similar. Something like:

| select @{n="UPN";e={(Get-Mailbox $_.MailboxGuid.Guid).UserPrincipalName}},ItemCount,TotalItemSize | sort TotalItemSize

Open in new window

0
 

Author Comment

by:nav2567
ID: 41769173
I just tried the below but it still doesnt work.  

get-mailboxstatistics -server myexchangeserver | sort-object totalitemsize -descending | select @{n="UPN";e={(Get-Mailbox $_.MailboxGuid.Guid).UserPrincipalName}},ItemCount,TotalItemSize | sort TotalItemSize
0
 
LVL 41

Expert Comment

by:Vasil Michev (MVP)
ID: 41769194
Well, check what the relevant properties are on-prem, I run this example against O365. I think the MailboxGuid wasnt available as output on-prem, so you might have to replace it with Guid or Identity or similar. What's the output of get-mailboxstatistics for a single user?
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 26

Accepted Solution

by:
-MAS earned 300 total points (awarded by participants)
ID: 41769267
Please try this and let me know.
Get-Mailbox -ResultSize Unlimited | sort-object | Select-Object DisplayName,UserPrincipalName,@{n="MailboxSizeMB";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.TotalItemSize.Value.ToMB()}},@{n="Mailcount";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.ItemCount}} | sort Mailcount

Open in new window


Thanks
MAS
0
 

Author Comment

by:nav2567
ID: 41772849
The command seems to works.  Thanks.  But I see errors - see attached.

Please advise again.
mbstaterr.png
0
 
LVL 26

Expert Comment

by:-MAS
ID: 41772857
Hi,
That warning is due to user is not logged on to the  mailbox.
You can ignore that.

Thanks
MAS
0
 
LVL 26

Expert Comment

by:-MAS
ID: 41798445
I believe this can be closed as per the comment (ID:41772849)  from the author.

Thanks
MAS
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to install and use the NTBackup utility that comes with Windows Server.
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question