NETWORK ADMINISTRATIONSWindows server

Check and Set Windows Defender Exchange 2019 Exclusions [Tested on Windows Server 2022]

Learn how to configure Windows Defender for systems running Exchange 2019 to prevent performance issues and ensure robust security. This guide covers essential steps for setting appropriate exclusions, verifying existing settings, and maintaining optimal system performance.

Check if windows defender exclusions are in place for exchange script:

# Define the folders and processes to be excluded
$exchangeFolders = @(
“C:Program FilesMicrosoftExchange ServerV15”,
“C:Program FilesMicrosoftExchange ServerV15Logging”,
“C:Program FilesMicrosoftExchange ServerV15TransportRolesDataQueue”,
“C:Program FilesMicrosoftExchange ServerV15TransportRolesDataTemporarySaves”,
“C:Program FilesMicrosoftExchange ServerV15ClientAccessOAB”,
“C:Program FilesMicrosoftExchange ServerV15ClientAccessSync”,
“C:Program FilesMicrosoftExchange ServerV15Mailbox”,
“C:Program FilesMicrosoftExchange ServerV15MailboxTransportSubmission”,
“C:Program FilesMicrosoftExchange ServerV15MailboxTransportDumpster”,
“C:Program FilesMicrosoftExchange ServerV15FIP-FSDATAEngines”,
“C:Program FilesMicrosoftExchange ServerV15FrontEndHttpProxyOAB”
)

$exchangeProcesses = @(
“Microsoft.Exchange.Activities.Host.exe”,
“Microsoft.Exchange.AddressBook.Service.exe”,
“Microsoft.Exchange.AddressBook.Service.ServiceHost.exe”,
“Microsoft.Exchange.AntispamUpdateSvc.exe”,
“Microsoft.Exchange.Assistants.exe”,
“Microsoft.Exchange.ComplianceLogUploader.exe”,
“Microsoft.Exchange.Diagnostics.ServiceHost.exe”,
“Microsoft.Exchange.EdgeSyncSvc.exe”,
“Microsoft.Exchange.FBA.Service.exe”,
“Microsoft.Exchange.Imap4.exe”,
“Microsoft.Exchange.Imap4BE.exe”,
“Microsoft.Exchange.MailboxAssistants.exe”,
“Microsoft.Exchange.Monitoring.exe”,
“Microsoft.Exchange.OABGenSvc.exe”,
“Microsoft.Exchange.Pop3.exe”,
“Microsoft.Exchange.Pop3BE.exe”,
“Microsoft.Exchange.RpcClientAccess.Service.exe”,
“Microsoft.Exchange.Search.HostController.exe”,
“Microsoft.Exchange.ServiceHost.exe”,
“Microsoft.Exchange.SubmissionSvc.exe”,
“Microsoft.Exchange.ThrottlingService.exe”,
“Microsoft.Exchange.Transport.exe”,
“Microsoft.Exchange.TransportLogSearch.Service.exe”,
“Microsoft.Exchange.TransportSync.Service.exe”,
“MSExchangeHMHost.exe”,
“MSExchangeHygieneData.exe”
)

# Function to check if a folder exclusion exists
function Check-FolderExclusion {
param (
[string]$folder
)

$exclusions = (Get-MpPreference).ExclusionPath
if ($exclusions -contains $folder) {
Write-Host “Folder exclusion exists: $folder” -ForegroundColor Green
} else {
Write-Host “Folder exclusion missing: $folder” -ForegroundColor Red
}
}

# Function to check if a process exclusion exists
function Check-ProcessExclusion {
param (
[string]$process
)

$exclusions = (Get-MpPreference).ExclusionProcess
if ($exclusions -contains $process) {
Write-Host “Process exclusion exists: $process” -ForegroundColor Green
} else {
Write-Host “Process exclusion missing: $process” -ForegroundColor Red
}
}

# Check folder exclusions
Write-Host “Checking folder exclusions…” -ForegroundColor Yellow
foreach ($folder in $exchangeFolders) {
Check-FolderExclusion -folder $folder
}

# Check process exclusions
Write-Host “`nChecking process exclusions…” -ForegroundColor Yellow
foreach ($process in $exchangeProcesses) {
Check-ProcessExclusion -process $process
}

Write-Host “`nExclusion check complete.” -ForegroundColor Cyan

source

windows server

Alice AUSTIN

Alice AUSTIN is studying Cisco Systems Engineering. He has passion with both hardware and software and writes articles and reviews for many IT websites.