When you manage Exchange 2019 Servers or Exchange 2016 Servers, whitespace is a common factor that has to be taken into account. The database will grow overtime as users gets added or removed or things change and eventually you end up with disks that cannot be extended and databases that are just too large and you backups are taking even longer to complete and the one way you can deal with that is performing mailbox moves and then removing the database at the end.

However, do you know the size of the whitespace on your Mailbox Database? Many admins don’t and I put together a script that can help you identify this. Below is a snippet of the output from the script on 4x databases in my lab

Show the whitespace of each mailbox database in exchange 2019


Here is the script that I used to get the whitespace information for each mailbox database:

# Import the Exchange module
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

# Get information about mailbox databases
$mailboxDatabases = Get-MailboxDatabase -Status

# Display information about whitespace for each database
foreach ($database in $mailboxDatabases) {
    $databaseName = $database.Name
    $whitespace = $database.AvailableNewMailboxSpace
    Write-Host "Database: $databaseName"
    Write-Host "Whitespace: $whitespace bytes"
    Write-Host "--------------------------------------"

You can change the output to CSV if you manage a large number of databases and it’s easier to work with.

Hope it helps


    Discover more from Everything-PowerShell

    Subscribe now to keep reading and get access to the full archive.

    Continue reading