To Count number of Transaction Log Files in Exchagne 2013


The below Exchange 2013 powershell script used to count the number of transaction log file getting generated by each Exchange 2013 Server Database. This information plays vital for the below action items

Exchange Transaction Log Count 

1. Helps to understand email flow data in each Exchange 2013 database.

2. Provide some estimation on the replication traffic.

3. Provide the detail is the transaction logs are getting purged after backup.

4. Disk space occupied for the transaction log (As each log size is 1 MB

$Output = “C:\Temp\Raji\ExchangeOutPut.txt”
$Databases =Get-MailboxDatabase
foreach ($DB in $Databases)
{
[string]$logPathString = $db.LogFolderPath
$MyDriveString =$logPathString.substring(0,1);
$MySubString=$logPathString.substring(0,2);
$UNCPath = “\\$($db.Server)\” + $MyDriveString + “$” ;
$Logfoldername = $logPathString.Replace($MySubString,$UNCPath);
Write-Output $Logfoldername
$Logfoldername | Out-File $Output -append
foreach ($Log in $Logfoldername)
{
$LogCount = dir $Log | group {$_.LastWriteTime.ToShortDateString()} | select Name,Count
Write-Output $LogCount
$LogCount | Out-File $Output -append
}
}

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 Exchange 2013 SP1, Exchange Powershell Scripts, Script, 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