PoshCode Archive  Artifact [0588c74f54]

Artifact 0588c74f5472bae4f1d1fa5017251628ceeebb605355a85fd697d02f1794aa50:

  • File Ex2010_MBDB_Info-check-for-Check_MK.ps1 — part of check-in [c4003360ae] at 2018-06-10 13:36:42 on branch trunk — Ex2010_MBDB_Info check for Check_MK (user: unknown size: 978)

# encoding: ascii
# api: powershell
# title: 
# description: Ex2010_MBDB_Info check for Check_MK
# version: 1.0
# license: CC0
# x-poshcode-id: 4110
# x-archived: 2013-05-09T09:33:12
#
#
If ([intptr]::size -eq 4) {
	$powerShellDir = $powershelldir = "$env:Windir\Sysnative\WindowsPowerShell\V1.0\"
	$dir = "& `"$env:ProgramFiles\Check_MK\plugins\Ex2010_MBDB_Info.ps1`""
	$bytes = [Text.Encoding]::Unicode.GetBytes($dir)
	$encodedCommand = [Convert]::ToBase64String($bytes)
	Invoke-Command -command { & $powershelldir\powershell.exe -EncodedCommand $encodedCommand }
}
Else {
	Write-Host '<<<Ex2010_MBDB_Info>>>' 
	Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 
	$DBS = Get-MailboxDatabase -Status -Server (hostname) 
	
	$DBS | % { '{0,-10} {1,-20} {2, -6}' -f $_.name, ($_.Databasesize -replace ',', ''-replace '^.*\((.*) bytes\)', '$1'), (Get-MailboxStatistics -Database $_.name|where { $_.DisconnectReason -ne 'SoftDeleted' }).count };
}