Created
November 20, 2021 11:05
-
-
Save nanoDBA/2bf8e484efad70fed139c0f0d3fa9a34 to your computer and use it in GitHub Desktop.
Disable and Uninstall Windows Defender - Requires Reboot
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
| if (! ( (Get-WindowsFeature -Name Windows-Defender-Features).Installed)) { | |
| Write-Output "Windows Defender is not installed" | Out-String | Write-Host -ForegroundColor Yellow | |
| } | |
| if ( (Get-WindowsFeature -Name Windows-Defender-Features).Installed) { | |
| #Disable Windows Defender http://www.thomasmaurer.ch/2016/07/how-to-disable-and-configure-windows-defender-on-windows-server-2016-using-powershell/ | |
| Set-MpPreference -DisableRealtimeMonitoring $true | |
| # uninstall Windows Defender https://technet.microsoft.com/en-us/windows-server-docs/security/windows-defender/windows-defender-overview-windows-server | |
| Get-WindowsFeature -Name Windows-Defender-Features | |
| Uninstall-WindowsFeature -Name Windows-Defender-Features -Confirm:$false | |
| Get-WindowsFeature -Name Windows-Defender-Features | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment