Solved

Collect mailbox statistics issue.

Posted on 2016-08-22
7
40 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

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 40

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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 25

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 25

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 25

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video discusses moving either the default database or any database to a new volume.

825 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