[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Exchange 2013 Powershell Command Help

Posted on 2016-09-19
11
Medium Priority
?
189 Views
Last Modified: 2016-09-29
Hello,
I have a specific Exchange 2013 database that has unlimited size restrictions. I would like to run a Powershell script that would look at ONLY that database and give me a list of the biggest mailboxes in descending order.  I've tried a couple of different get-mailbox commands and it's not working out perfectly.

Can you please help?
Thanks in advance.
0
Comment
Question by:zito2000
[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
  • 3
  • 2
  • +3
11 Comments
 
LVL 19

Expert Comment

by:suriyaehnop
ID: 41804947
Try use this powershell from microsoft gallery

https://technet.microsoft.com/en-us/library/bb124612(v=exchg.160).aspx
0
 
LVL 27

Expert Comment

by:MAS
ID: 41804951
Hi,
Please try the below command
Get-Mailbox | Get-MailboxStatistics | select displayname,TotalItemSize | Sort-Object TotalItemSize -Descending

Open in new window


This is for single database
Get-Mailbox -database database1 | Get-MailboxStatistics | select displayname,TotalItemSize | Sort-Object TotalItemSize -Descending

Open in new window


Hope it helps
1
 

Author Comment

by:zito2000
ID: 41804991
I've attempted all of these commands, but not getting great results unfortunately.  
This command:
Get-MailboxStatistics -Database "Database1"

Gives me a list of mailboxes and item count, but not size.  I'm thinking we could add something to this command to show the size...!?
0
Are your AD admin tools letting you down?

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 49

Assisted Solution

by:Akhater
Akhater earned 600 total points
ID: 41805021
Get-Mailbox -ResultSize unlimited -Database "UnlimitedDB" | Get-MailboxStatistics | select-object Displayname, @{expression = {$_.TotalItemSize.Value.ToMB()};label="TotalItemSizeMB"} | sort TotalItemSizeMB -Descending 

Open in new window


if the above doesn't work for you give us the output to be able to help
1
 
LVL 71

Accepted Solution

by:
Qlemo earned 1400 total points
ID: 41805105
Get-MailboxStatististics -Database Database1 | select-object Displayname, @{ n = 'TotalItemSizeMB'; e = {$_.TotalItemSize.Value.ToMB()} } | sort TotalItemSizeMB -Descending 

Open in new window

You need to enumerate the properties you want to get in the output, as the default formatting is not displaying the size and much more. The explicit extraction of the size is recommended because you get a complex object (with sizes in Bytes, GB etc.) otherwise, with no useful default formatting IMHO.
1
 

Author Comment

by:zito2000
ID: 41805195
Well this just shifted gears...I ran the command that Akhater described and when I press <enter> it just goes to the next line.  No error, nothing.  I've tried this command on 2 different mailbox servers and tried querying multiple mailbox databases and the same result.  That is bizarre.  See screen shot.  Thoughts?
Commands.png
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41805208
Certain there are mailboxes in that database? You should be, as you got results earlier.
Try my more direct suggestion, please.
0
 
LVL 49

Expert Comment

by:Akhater
ID: 41805217
since you said that Get-MailboxStatistics -Database "Database1" gave back results I am not sure why my command didn't work for you but you could just skip the first part and convert it to the below which would be very much the same as what Qlemo proposed


Get-MailboxStatistics -Database "Database1" | select-object Displayname, @{expression = {$_.TotalItemSize.Value.ToMB()};label="TotalItemSizeMB"} | sort TotalItemSizeMB -Descending 

Open in new window

0
 

Author Comment

by:zito2000
ID: 41805219
Thanks Qlemo, your solution worked.  Yes, there are mailboxes in there and your command:
Get-MailboxStatististics -Database Database1 | select-object Displayname, @{ n = 'TotalItemSizeMB'; e = {$_.TotalItemSize.Value.ToMB()} } | sort TotalItemSizeMB -Descending

Worked perfectly.  
Thank you for your help!
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 41805246
It remains to be strange, as there should be no difference ...
1
 
LVL 1

Expert Comment

by:LinuxDude
ID: 41821836
get-mailboxstatistics -database "database name" | select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending
0

Featured Post

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

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

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Suggested Courses

656 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