How to find Exchange Server 2013 Database File Size


How to find Exchange Server 2013 Database File Size

The below powershell command provide easier way to find each database .edb file size located in the server and also it provides additional information regarding the backup and onlinemaintenance status of the exchange 2013 database file

Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | ft Name, DatabaseSize, AvailableNewMailboxSpace, Mounted, BackupInProgress, OnlineMaintenanceInProgress

Script  – Exchange 2013 EDB file Size

#HTML Format Style#

Param
(
[string]$path = “c:\temp\Raji\ExchangeDBFileSize.html”
)

$a = “<style>”
$a = $a + “BODY{background-color:peachpuff;}”
$a = $a + “TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}”
$a = $a + “TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}”
$a = $a + “TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}”
$a = $a + “</style>”
$a = $a + “<h1> Exchange Server EDB File Size Report</h1>”
$a = $a + “<h2> The following report was run on $(get-date) </h2>”

#SMTP Address Detail#

$smtpServer = “mail.hotmail.com”
$smtpFrom = “Admin@hotmail.com”
$smtpTo = “Rajis@hotmail.com”
$messageSubject = “Exchange Servers DB File Size”

$message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
$message.Subject = $messageSubject

$message.IsBodyHTML = $true

$message.Body = Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Select-Object Name, DatabaseSize,AvailableNewMailboxSpace,
Mounted, BackupInProgress | ConvertTo-HTML -head $a | Out-File $path

$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($message)

Invoke-Item $path

 

 

Advertisements

About Raji Subramanian

Nothing great to say about me...Just want to share my knowledge for others that will be useful at any moment of time when they stuck in critical issue....
This entry was posted in Commands, Exchange Server, OWA 2013, Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s