From ef1cecea84b8c515b4a7ca986f645ab23dd8fa7e Mon Sep 17 00:00:00 2001 From: David Paulson Date: Tue, 3 Aug 2021 11:05:36 -0500 Subject: [PATCH 1/2] Added server name to debug log file name --- Diagnostics/HealthChecker/HealthChecker.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Diagnostics/HealthChecker/HealthChecker.ps1 b/Diagnostics/HealthChecker/HealthChecker.ps1 index 5842be677f..a1eb17fda3 100644 --- a/Diagnostics/HealthChecker/HealthChecker.ps1 +++ b/Diagnostics/HealthChecker/HealthChecker.ps1 @@ -314,7 +314,11 @@ Function Main { } try { - $Script:Logger = New-LoggerObject -LogName "HealthChecker-Debug" -LogDirectory $OutputFilePath -VerboseEnabled $Script:VerboseEnabled -EnableDateTime $false -ErrorAction SilentlyContinue + $Script:Logger = New-LoggerObject -LogName "HealthChecker-$($Script:Server)-Debug" ` + -LogDirectory $OutputFilePath ` + -VerboseEnabled $Script:VerboseEnabled ` + -EnableDateTime $false ` + -ErrorAction SilentlyContinue Main } finally { Get-ErrorsThatOccurred From 53b15da1d6c3aa2a90bb143b871ee1095c92aacf Mon Sep 17 00:00:00 2001 From: David Paulson Date: Tue, 3 Aug 2021 11:12:06 -0500 Subject: [PATCH 2/2] Set all output files to have the similar starting name of "HealthChecker" --- .../HealthChecker/Features/Get-ExchangeDcCoreRatio.ps1 | 2 +- Diagnostics/HealthChecker/HealthChecker.ps1 | 6 +++--- .../Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Diagnostics/HealthChecker/Features/Get-ExchangeDcCoreRatio.ps1 b/Diagnostics/HealthChecker/Features/Get-ExchangeDcCoreRatio.ps1 index 450a3e81e5..183f576e7d 100644 --- a/Diagnostics/HealthChecker/Features/Get-ExchangeDcCoreRatio.ps1 +++ b/Diagnostics/HealthChecker/Features/Get-ExchangeDcCoreRatio.ps1 @@ -41,7 +41,7 @@ Function Get-ComputerCoresObject { Function Get-ExchangeDCCoreRatio { - Invoke-ScriptLogFileLocation -FileName "HealthCheck-ExchangeDCCoreRatio" + Invoke-ScriptLogFileLocation -FileName "HealthChecker-ExchangeDCCoreRatio" Write-Verbose "Calling: $($MyInvocation.MyCommand)" Write-Grey("Exchange Server Health Checker Report - AD GC Core to Exchange Server Core Ratio - v{0}" -f $BuildVersion) $coreRatioObj = New-Object PSCustomObject diff --git a/Diagnostics/HealthChecker/HealthChecker.ps1 b/Diagnostics/HealthChecker/HealthChecker.ps1 index a1eb17fda3..dcb262b560 100644 --- a/Diagnostics/HealthChecker/HealthChecker.ps1 +++ b/Diagnostics/HealthChecker/HealthChecker.ps1 @@ -206,7 +206,7 @@ Function Main { } if ($LoadBalancingReport) { - Invoke-ScriptLogFileLocation -FileName "LoadBalancingReport" + Invoke-ScriptLogFileLocation -FileName "HealthChecker-LoadBalancingReport" Write-Green("Client Access Load Balancing Report on " + $date) Get-CASLoadBalancingReport Write-Grey("Output file written to " + $OutputFullPath) @@ -227,7 +227,7 @@ Function Main { } if ($MailboxReport) { - Invoke-ScriptLogFileLocation -FileName "HealthCheck-MailboxReport" -IncludeServerName $true + Invoke-ScriptLogFileLocation -FileName "HealthChecker-MailboxReport" -IncludeServerName $true Get-MailboxDatabaseAndMailboxStatistics Write-Grey("Output file written to {0}" -f $Script:OutputFullPath) return @@ -260,7 +260,7 @@ Function Main { return } - Invoke-ScriptLogFileLocation -FileName "HealthCheck" -IncludeServerName $true + Invoke-ScriptLogFileLocation -FileName "HealthChecker" -IncludeServerName $true $currentErrors = $Error.Count if ((-not $SkipVersionCheck) -and diff --git a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 index 838646afff..8cf0d32d9e 100644 --- a/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 +++ b/Diagnostics/HealthChecker/Helpers/Get-HealthCheckFilesItemsFromLocation.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. Function Get-HealthCheckFilesItemsFromLocation { - $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthCheck-*-*.xml" } + $items = Get-ChildItem $XMLDirectoryPath | Where-Object { $_.Name -like "HealthChecker-*-*.xml" } if ($null -eq $items) { Write-Host("Doesn't appear to be any Health Check XML files here....stopping the script")