Get Number of Mailboxes Per Database (Global)
get-mailbox -resultsize unlimited | group-object -property Database –noelement
Get a count of all mailboxes in database (per DB)
Get-mailboxdatabase -identity EX10mbx07 | Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize
Get a count of all mailboxes in Exchange
Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize
Get Name of Database with the lease amount of users
Get-MailboxDatabase | Select-Object Name,@{Name=”Count”;Expression={Get-MDBMailboxCount -DN $_.DistinguishedName}} | Sort-Object count
Get Database Quotas
Get-MailboxDatabase | ft name,ProhibitSendReceiveQuota,ProhibitSendQuota,RecoverableItemsQuota,RecoverableItemsWarningquota, IssueWarningQuota -auto
Set Database Quotas
Set-MailboxDatabase -identity EX10mbx47 -ProhibitSendReceiveQuota 2.3GB -ProhibitSendQuota 2GB -IssueWarningQuota 1.899GB
Get WhiteSpace for database
Get-MailboxDatabase -identity EX10mbx08 -Status | Select Servername, Name, AvailableNewMailboxSpace
Get All Mailbox Sizes over 1GB in Database and sort them by size
Get-MailboxStatistics -Database ‘EX10mbx02’ | where {$_.Totalitemsize -gt 1GB} | Sort-Object -Property TotalItemSize -Descending | Format-Table DisplayName,TotalItemSize
Get Database Mounted Status
Get-MailboxDatabase -Status | Select Name, Server, Mounted
Get ALL Quotas for the Database
Get-MailboxDatabase -Identity “EX10mbx19” | fl *quota*
Export All Users in the database
Get-Mailbox -Database EX10mbx01 -ResultSize Unlimited > c:\dame\export.txt
Get all Exchange Database Sizes in DAG
Get-MailboxDatabase -Status | Sort-Object -Property DatabaseSize -descending | ft ServerName,Name,DatabaseSize -autosize
Get Single Database Size
Get-MailboxDatabase -identity EX10mbx02 -Status | ft ServerName,Name,DatabaseSize -autosize
Get All Users in specific Mailbox Database like 2003 View
Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime
Status information for all copies of the database and details
Get-MailboxDatabaseCopyStatus -Identity ‘EX10mbx08’ | fl name, server, activationpreference,Status,CopyQueueLength,ContentIndexState,LatestFullBackupTime, ActiveCopy,ErrorEventID,errormessage
Get ALL MOUNTED Mailbox Databases and Find the Active Servers
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | ? {$_.ActiveCopy -eq $true} | sort name | ft mailboxserver,DatabaseName, Status,ContentIndexState -autosize
Status for all database copies on the Mailbox server EX1001
Get-MailboxDatabaseCopyStatus -Server EX1011 | fl DatabaseName, ContentIndexState, ActiveCopy, CopyQueueLength
Get All Database Copy
Get-MailboxDatabaseCopy
Get Number of Mailboxes Per Database (Global)
get-mailbox -resultsize unlimited | group-object -property Database –noelement
Get a count of all mailboxes in database (per DB)
Get-mailboxdatabase -identity EX10mbx07 | Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize
Get a count of all mailboxes in Exchange
Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize
Get Name of Database with the lease amount of users
Get-MailboxDatabase | Select-Object Name,@{Name=”Count”;Expression={Get-MDBMailboxCount -DN $_.DistinguishedName}} | Sort-Object count
Get Database Quotas
Get-MailboxDatabase | ft name,ProhibitSendReceiveQuota,ProhibitSendQuota, RecoverableItemsQuota,RecoverableItemsWarningquota,IssueWarningQuota -auto
Set Database Quotas
Set-MailboxDatabase -identity EX10mbx47 -ProhibitSendReceiveQuota 2.3GB -ProhibitSendQuota 2GB -IssueWarningQuota 1.899GB
Get WhiteSpace for database
Get-MailboxDatabase -identity EX10mbx08 -Status | Select Servername, Name, AvailableNewMailboxSpace
Get All Mailbox Sizes over 1GB in Database and sort them by size
Get-MailboxStatistics -Database ‘EX10mbx02’ | where {$_.Totalitemsize -gt 1GB} | Sort-Object -Property TotalItemSize -Descending | Format-Table DisplayName,TotalItemSize
Get Database Mounted Status
Get-MailboxDatabase -Status | Select Name, Server, Mounted
Get ALL Quotas for the Database
Get-MailboxDatabase -Identity “EX10mbx19” | fl *quota*
Export All Users in the database
Get-Mailbox -Database EX10mbx01 -ResultSize Unlimited > c:\dame\export.txt
Get all Exchange Database Sizes in DAG
Get-MailboxDatabase -Status | Sort-Object -Property DatabaseSize -descending | ft ServerName,Name,DatabaseSize -autosize
Get Single Database Size
Get-MailboxDatabase -identity EX10mbx02 -Status | ft ServerName,Name,DatabaseSize -autosize
Get All Users in specific Mailbox Database like 2003 View
Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime
Status information for all copies of the database and details
Get-MailboxDatabaseCopyStatus -Identity ‘EX10mbx08’ | fl name, server, activationpreference,Status,CopyQueueLength,ContentIndexState,LatestFullBackupTime,ActiveCopy,ErrorEventID,errormessage
Get ALL MOUNTED Mailbox Databases and Find the Active Servers
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | ? {$_.ActiveCopy -eq $true} | sort name | ft mailboxserver,DatabaseName, Status,ContentIndexState -autosize
Status for all database copies on the Mailbox server EX1001
Get-MailboxDatabaseCopyStatus -Server EX1011 | fl DatabaseName, ContentIndexState, ActiveCopy, CopyQueueLength
Get All Database Copy
Get-MailboxDatabaseCopy
Get Deleted Item retention Stats
Get-mailboxdatabase | sort-object name | ft name,deleteditemretention -AutoSize
Problem is, Get-MailboxStatistics output just a display name – not unique and cant really be used as such. The other half of the information you need is in Get-Mailbox :- found answer in following link. once you have the data on all your mailboxes, and the output can be IMPORTED into excel you can do all your sorting etc and delete whatever you dont want
***if this is what you were looking for, please click this link and give the guy some credit.. i didnt come up with this, i just found it
#REM http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_27828458.html
$Mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($Mailbox in $Mailboxes)
{
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “MailboxSizeMB” -Value ((Get-MailboxStatistics $Mailbox).TotalItemSize.Value.ToMb())
}
$Mailboxes | Sort-Object MailboxSizeMB -Desc | Select PrimarySMTPAddress, MailboxSizeMB
#REM – to export this out — do the following 😉 enjoy (see the part where it says “Select” you can add additional fields like ALIAS etc to this)
$Mailboxes = Get-Mailbox -ResultSize Unlimited
foreach ($Mailbox in $Mailboxes)
{
$Mailbox | Add-Member -MemberType “NoteProperty” -Name “MailboxSizeMB” -Value ((Get-MailboxStatistics $Mailbox).TotalItemSize.Value.ToMb())
}
$Mailboxes | Sort-Object MailboxSizeMB -Desc | Select PrimarySMTPAddress, MailboxSizeMB | Export-Csv -NoType “C:\temp\Mailboxessize.csv”