Test-ExchAVExclusions: add the server name to the output files - #2578
Open
DKhrebin wants to merge 1 commit into
Open
Test-ExchAVExclusions: add the server name to the output files#2578DKhrebin wants to merge 1 commit into
DKhrebin wants to merge 1 commit into
Conversation
I want to see the server name in the results. Engineers often share only one of the output files, and when the data comes from several servers there is nothing in the file that says which server it belongs to. Stamp the computer name into the BadExclusions and Results/Debug file names and into the header line written inside them.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the usability of Test-ExchAVExclusions output artifacts by including the server name in the generated filenames and in-file headers, making it easier to correlate shared output files back to their originating server in multi-server investigations.
Changes:
- Prefixes the script’s log file base name with
$env:COMPUTERNAME, resulting in per-server Results/Debug log filenames. - Stamps
$env:COMPUTERNAMEinto theBadExclusions-...output filename and the header line written inside that file. - Updates the public documentation to reflect the inclusion of server name in output filenames.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Diagnostics/AVTester/Test-ExchAVExclusions.ps1 |
Adds server name to log/output filenames and stamps server name into the BadExclusions header; updates .OUTPUTS block. |
docs/Diagnostics/Test-ExchAVExclusions.md |
Updates documented output filename patterns to include server name. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
48
to
+52
| Log file: | ||
| $PSScriptRoot\Test-ExchAvExclusions-#DataTime#.txt | ||
| $PSScriptRoot\Test-ExchAvExclusions-#ServerName#-#DataTime#.txt | ||
|
|
||
| List of Scanned Folders: | ||
| $PSScriptRoot\BadExclusions-#DataTime#.txt | ||
| $PSScriptRoot\BadExclusions-#ServerName#-#DataTime#.txt |
Comment on lines
63
to
+67
| Log file: | ||
| $PSScriptRoot\Test-ExchAvExclusions-#DateTime#.txt | ||
| $PSScriptRoot\Test-ExchAvExclusions-#ServerName#-#DateTime#.txt | ||
|
|
||
| List of Folders, extensions Scanned by AV and List of Non-Default Processes: | ||
| $PSScriptRoot\BadExclusions-#DateTime#.txt | ||
| $PSScriptRoot\BadExclusions-#ServerName#-#DateTime#.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I want to see the server name in the results.
Engineers often share only one of the output files, and when the data comes from
several servers there is nothing in the file that says which server it belongs to.
The only identifier today is a timestamp, which does not help.
This change stamps the computer name into both the file names and the header line
written inside them:
BadExclusions-<SERVER>-<date>.txt->Exclusions analysis on server <SERVER> at ...Test-ExchAvExclusions-<SERVER>-Results-<date>.txtTest-ExchAvExclusions-<SERVER>-Debug-<date>.txtThe Results/Debug logs are covered by a single change to
$LogFileNameplus theexisting version banner, which is written to both loggers.
Docs updated in the script
.OUTPUTSblock and indocs/Diagnostics/Test-ExchAVExclusions.md.Tested on Exchange Server SE (WS2025-SE-DEBUG) with the script built from
dist/:all three files are produced with the server name in the name and in the content.
.build\CodeFormatter.ps1, cspell and.build\Build.ps1all pass.