Mailbox database size powershell
A great topic!
To check the size of a mailbox database in PowerShell, you can use the following commands:
Method 1: Using the Get-MailboxDatabase cmdlet
Get-MailboxDatabase -Status | Select-Object Name, DatabaseSize
This command retrieves the list of mailbox databases and their sizes. The Status
parameter is used to retrieve the database size.
Method 2: Using the Get-MailboxDatabaseStatistics cmdlet
Get-MailboxDatabaseStatistics | Select-Object DatabaseName, TotalDatabaseSize
This command retrieves the mailbox database statistics, including the total database size.
Method 3: Using the Get-MailboxDatabase cmdlet with the -Statistics parameter
Get-MailboxDatabase -Statistics | Select-Object Name, DatabaseSize
This command retrieves the mailbox database statistics, including the database size.
Example output:
Name DatabaseSize
---- ------------
Mailbox Database 1 10 GB
Mailbox Database 2 20 GB
Mailbox Database 3 5 GB
In this example, the output shows the name of each mailbox database and its corresponding size.
Tips:
- You can use the
Format-Table
cmdlet to format the output in a more readable way. - You can use the
Sort-Object
cmdlet to sort the output by database size or name. - You can use the
Get-MailboxDatabase
cmdlet with the-Filter
parameter to filter the output by specific criteria, such as database size or name.