You can disable Microsoft Defender real-time protection as follows:
Set-MpPreference -DisableRealtimeMonitoring $true
Disable cloud-based protection:
Set-MpPreference -MAPSReporting 0
This will suspend antivirus protection in Windows until the next restart.
To uninstall Windows Defender on Windows Server 2022, you can use the following methods:
PowerShell
Uninstall-WindowsFeature -Name Windows-Defender
reboot required
Remove Roles and Features wizard Use the wizard to install or uninstall roles, role services, or features. In the Features step, clear the Windows Defender Features option
Group Policy In the Local Group Policy Editor, navigate to:
https://theitbros.com/managing-windows-defender-using-powershell/