Skip to content

Test-ExchAVExclusions: add the server name to the output files - #2578

Open
DKhrebin wants to merge 1 commit into
microsoft:mainfrom
DKhrebin:dkhrebin-avexclusions-servername
Open

Test-ExchAVExclusions: add the server name to the output files#2578
DKhrebin wants to merge 1 commit into
microsoft:mainfrom
DKhrebin:dkhrebin-avexclusions-servername

Conversation

@DKhrebin

Copy link
Copy Markdown
Contributor

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>.txt
  • Test-ExchAvExclusions-<SERVER>-Debug-<date>.txt

The Results/Debug logs are covered by a single change to $LogFileName plus the
existing version banner, which is written to both loggers.

Docs updated in the script .OUTPUTS block and in docs/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.ps1 all pass.

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.
Copilot AI lite review requested due to automatic review settings August 28, 2026 15:55
@DKhrebin
DKhrebin requested a review from a team as a code owner August 28, 2026 15:55
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:COMPUTERNAME into the BadExclusions-... 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants