Skip to content

Commit

Permalink
Include Get-AcceptedDomain, Get-RemoteDomain, and Get-TransportRule i…
Browse files Browse the repository at this point in the history
…n log collector
  • Loading branch information
dpaulson45 committed Oct 2, 2023
1 parent 9430767 commit e7e0f99
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Diagnostics/ExchangeLogCollector/ExchangeLogCollector.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ param (
[Parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[Alias('Fqdn')]
[string[]]$Servers = @($env:COMPUTERNAME),
[switch]$AcceptedRemoteDomain,
[switch]$ADDriverLogs,
[bool]$AppSysLogs = $true,
[bool]$AppSysLogsToXml = $true,
Expand Down Expand Up @@ -56,6 +57,7 @@ param (
[switch]$TransportAgentLogs,
[switch]$TransportConfig,
[switch]$TransportRoutingTableLogs,
[switch]$TransportRules,
[switch]$WindowsSecurityLogs,
[switch]$AllPossibleLogs,
[Alias("CollectAllLogsBasedOnDaysWorth")]
Expand Down
2 changes: 2 additions & 0 deletions Diagnostics/ExchangeLogCollector/Helpers/Get-ArgumentList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function Get-ArgumentList {
}

return [PSCustomObject]@{
AcceptedRemoteDomain = $AcceptedRemoteDomain
ADDriverLogs = $ADDriverLogs
AnyTransportSwitchesEnabled = $Script:AnyTransportSwitchesEnabled
AppSysLogs = $AppSysLogs
Expand Down Expand Up @@ -79,6 +80,7 @@ function Get-ArgumentList {
TransportAgentLogs = $TransportAgentLogs
TransportConfig = $TransportConfig
TransportRoutingTableLogs = $TransportRoutingTableLogs
TransportRules = $TransportRules
WindowsSecurityLogs = $WindowsSecurityLogs
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function Test-PossibleCommonScenarios {
$Script:FrontEndProtocolLogs = $true
$Script:MailboxDeliveryThrottlingLogs = $true
$Script:PipelineTracingLogs = $true
$Script:TransportRules = $true
$Script:AcceptedRemoteDomain = $true
}

if ($ConnectivityLogs) {
Expand Down Expand Up @@ -87,6 +89,8 @@ function Test-PossibleCommonScenarios {
$Script:MessageTrackingLogs = $true
$Script:QueueInformation = $true
$Script:TransportConfig = $true
$Script:TransportRules = $true
$Script:AcceptedRemoteDomain = $true
}

if ($OutlookConnectivityIssues) {
Expand Down Expand Up @@ -123,7 +127,9 @@ function Test-PossibleCommonScenarios {
$TransportAgentLogs -or
$TransportRoutingTableLogs -or
$DefaultTransportLogging -or
$PipelineTracingLogs) {
$PipelineTracingLogs -or
$TransportRules -or
$AcceptedRemoteDomain) {
$Script:AnyTransportSwitchesEnabled = $true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ function Write-DataOnlyOnceOnMasterServer {
Save-DataInfoToFile -dataIn $data -SaveToLocation $target -AddServerName $false
}

if ($TransportRules) {
$target = $RootCopyToDirectory + "\TransportRules"
$data = Get-TransportRule

# If no rules found, we want to report that.
if ($null -ne $data) {
Save-DataInfoToFile -dataIn $data -SaveToLocation $target -AddServerName $false
} else {
Save-DataInfoToFile -dataIn "No Transport Rules Found" -SaveXMLFile $false -SaveToLocation $target -AddServerName $false
}
}

if ($AcceptedRemoteDomain) {
$target = $RootCopyToDirectory + "\AcceptedDomain"
$data = Get-AcceptedDomain
Save-DataInfoToFile -dataIn $data -SaveToLocation $target -AddServerName $false

$target = $RootCopyToDirectory + "\RemoteDomain"
$data = Get-RemoteDomain
Save-DataInfoToFile -dataIn $data -SaveToLocation $target -AddServerName $false
}

if ($Error.Count -ne 0) {
Save-DataInfoToFile -DataIn $Error -SaveToLocation ("$RootCopyToDirectory\AllErrors")
Save-DataInfoToFile -DataIn (Get-UnhandledErrors) -SaveToLocation ("$RootCopyToDirectory\UnhandledErrors")
Expand Down
4 changes: 3 additions & 1 deletion docs/Diagnostics/ExchangeLogCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ Parameter | Description |
----------|-------------|
FilePath | The Location of where you would like the data to be copied over to. This location **must** be the same and accessible on all servers if you use the Servers parameter. Default value: C:\MS_Logs_Collection |
Servers | An array of servers that you would like to collect data from.
AcceptedRemoteDomain | Enable to collect `Get-AcceptedDomain` and `Get-RemoteDomain`.
ADDriverLogs | Enable to collect AD Driver Logs. Location: `V15\Logging\ADDriver`
AppSysLogs | Collects the Windows Event Application, System, and MSExchange Management Logs. Default value `$true`
AppSysLogsToXml | Collects the Windows Event Application and System and saves them out to XML. The time range only is from the time the script run and the value set on `LogAge`. Default value: `$true`
AutoDLogs | Enable to collect AutoDiscover Logs. Location: `V15\Logging\Autodiscover` and `V15\Logging\HttpProxy\Autodiscover`
CollectFailoverMetrics | Enable to run the `CollectOverMetrics.ps1` script against the DAG. Only able to be run on an Exchange tools box or an Exchange Server.
DAGInformation | Enable to collect the DAG Information from all different DAGs that are in the list of servers.
DailyPerformanceLogs | Enable to collect Daily Performance Logs. Default Location: `V15\Logging\Diagnostics\DailyPerformanceLogs`
DefaultTransportLogging | Enables the following switches and their logs to be collected. `FrontEndConnectivityLogs`, `FrontEndProtocolLogs`, `HubConnectivityLogs`, `MailboxConnectivityLogs`, `MailboxDeliveryThrottlingLogs`, `MessageTrackingLogs`, `PipelineTracingLogs`, `QueueInformation`, `ReceiveConnectors`, `SendConnectors`, and `TransportConfig`
DefaultTransportLogging | Enables the following switches and their logs to be collected. `AcceptedRemoteDomain`, `FrontEndConnectivityLogs`, `FrontEndProtocolLogs`, `HubConnectivityLogs`, `MailboxConnectivityLogs`, `MailboxDeliveryThrottlingLogs`, `MessageTrackingLogs`, `PipelineTracingLogs`, `QueueInformation`, `ReceiveConnectors`, `SendConnectors`, `TransportConfig`, `TransportRoutingTableLogs`, and `TransportRules`
EASLogs | Enable to collect Exchange Active Sync Logging. Location: `V15\Logging\HttpProxy\Eas`
ECPLogs | Enable to collect ECP Logs. Location: `V15\Logging\ECP` and `V15\Logging\HttpProxy\Ecp`
EWSLogs | Enable to collect EWS Logs. Location: `V15\Logging\HttpProxy\Ews` and `V15\Logging\Ews`
Expand Down Expand Up @@ -109,6 +110,7 @@ ServerInformation | Enable to collect general server information.
TransportAgentLogs | Enable to collect the Agent Logs. Location: `(Get-TransportService $server).AgentLogPath`, `(Get-FrontendTransportService $server).AgentLogPath`, `(Get-MailboxTransportService $server).MailboxSubmissionAgentLogPath`, and `(Get-MailboxTransportService $server).MailboxDeliveryAgentLogPath`
TransportConfig | Enable to collect the Transport Configuration files from the Server and `Get-TransportConfig` from the org. Files: `EdgeTransport.exe.config`, `MSExchangeFrontEndTransport.exe.config`, `MSExchangeDelivery.exe.config`, and `MSExchangeSubmission.exe.config`
TransportRoutingTableLogs | Enable to collect the Routing Table Logs. Location: `(Get-TransportService $server).RoutingTableLogPath`, `(Get-FrontendTransportService $server).RoutingTableLogPath`, and `(Get-MailboxTransportService $server).RoutingTableLogPath`
TransportRules | Enable to collect `Get-TransportRule`.
WindowsSecurityLogs | Enable to collect the Windows Security Logs. Default Location: `'C:\Windows\System32\WinEvt\Logs\Security.evtx'`
AllPossibleLogs | Enables the collection of all default logging collection on the Server.
CollectAllLogsBasedOnLogAge | Boolean to determine if you collect all the logs based off the log's age or all the logs in that directory. Default value `$true`
Expand Down

0 comments on commit e7e0f99

Please sign in to comment.