If you are running Exchange, you are aware that you need to exclude certain folders, processes etc. from scanning for Exchange to run optimally.

Now if you have System Center Configuration Manager (SCCM) in your environment, adding exclusions is easy and you can paste many lines in to the list.

However with no SCCM and just a + button you can only add 1 item at a time. With so many exclusions for Exchange, this can be rather tedious.

Here is a sample of adding an exclusion with Powershell:

  • Add-MpPreference -ExclusionPath “%ExchangeInstallPath%ClientAccess\OAB”
Windows powershell:- adding windows defender exclusions

You can refresh Windows Defender in Settings and you will now see the above path excluded.

Windows powershell:- adding windows defender exclusions

If you wanted to exclude an extension then you can run this command:

  • Add-MpPreference -ExclusionExtension “.chk”
Windows powershell:- adding windows defender exclusions
Windows powershell:- adding windows defender exclusions

Hope it helps.

    wpChatIcon

    Discover more from Everything-PowerShell

    Subscribe now to keep reading and get access to the full archive.

    Continue reading