Powershell to get the complete Exchange Database Name,Edb filepath and log file path into a Single file Report

Powershell to get the complete Exchange Database Name,Edb filepath and log file path into a Single file Report

$exchangeservers = Get-ExchangeServer |where-object {$_.admindisplayversion.major -eq 8 -and $_.IsMailboxServer -eq $true }
$result = "Servername | Database Name | EDB file Path | Log files Path"
$result > DBresultfile.txt
foreach ($server in $exchangeservers)
{
 $db = Get-MailboxDatabase -server $server
 $servername = $server.name
 foreach ($objItem in $db)
  {
  $result = $servername + " | " + $objItem.Name  + " | " + ($objItem.EdbFilePath).pathname + " | " + ((Get-StorageGroup $objItem.StorageGroup | select LogFolderPath).LogFolderPath).pathname
  $result
  $result >> DBresultfile.txt
  }
}

2 thoughts on “Powershell to get the complete Exchange Database Name,Edb filepath and log file path into a Single file Report

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