Wondering how many log files are generated per server every minute? Quickly find out by typing:   Leave a comment

 

Get-MailboxDatabase -Server $env:ComputerName | ?{ %{$_.DatabaseCopies | ?{$_.ReplayLagTime -ne [TimeSpan]::Zero -And $_
.HostServerName -eq $env:ComputerName} } } | %{ $count = 0; $MinT = [DateTime]::MaxValue; $MaxT = [DateTime]::MinValue;
Get-ChildItem -Path $_.LogFolderPath -Filter “*????.log” | %{ $count = $count + 1; if($_.LastWriteTime -gt $MaxT){ $MaxT
= $_.LastWriteTime}; if($_.LastWriteTime -lt $MinT){ $MinT= $_.LastWriteTime} }; ($count / ($MaxT.Subtract($MinT)).Tota
lMinutes) } | Measure-Object -Min -Max -Ave

Advertisements

Posted June 30, 2014 by Prem Rana in EMS Commands (Powershell)

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

%d bloggers like this: