Solved

Collect mailbox statistics issue.

Posted on 2016-08-22
7
52 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 42

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 42

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

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 27

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 27

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

624 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