Created
August 21, 2017 22:05
-
-
Save bobfrankly/5f9f3d4af0a5c9e4eec50d163b135499 to your computer and use it in GitHub Desktop.
Exchange 2010 Database filespace details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-DBData{ | |
$mailBoxDBs = Get-Mailboxdatabase -status | select * | |
foreach ($mbdb in $mailBoxDBs){ | |
$thisDBdrive = $mbdb.edbfilepath.tostring().split(":")[0] | |
$thisDriveFree = invoke-command -ComputerName $mbdb.server -ArgumentList $thisDBdrive -ScriptBlock {param($drive) get-PSDrive $drive | select @{name="FreeGB";expression={[math]::round(($_.free / 1GB),2)}}} | select -expand FreeGB | |
$mbdb | select name, Databasesize, AvailableNewMailboxSpace, @{name="DriveFreeGB";expression={$thisdrivefree}}, server | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment