Windows Defender Passive Mode / disable for servers when running another AV

We are currently doing this with Automate but want to move it over to Immy.

We would like a task to automatically disable Windows Defender on Serverswhen another antivirus is installed. Alternatively, the script can also attempt to enter passive mode