locked
Install Microsoft Antimalware on ARM Azure VM using Powershell RRS feed

  • Question

  • I am unable to find a way to install AntiMalware on an existing Windows Server 2012 VM on Azure created via ARM.

    Have tried to follow the documentation for VM's and using the Powershell cmdlet 'Set-AzureVMMicrosoftAntimalwareExtension' however I do not have access to this cmdlet. Have updated Azure Powershell on my local machine but think that the 'Set-AzureVMMicrosoftAntimalwareExtension'  cmdlet hasn't been ported over to the latest Powershell Az module. Cannot find an equivalent either in the Az.Security or Az.Compute service modules.

    Can anybody help. The reason why I wan to use Powershell is I want to apply the AntiMalware to existing VM's and supply a configuration consisting of exclusion lists etc and want this to be automated.


    Sachin

    Thursday, October 10, 2019 1:59 PM

All replies

  • What do you mean when you say you do not have access to this cmdlet.  What is the error you are getting.  I am not seeing any issues running this cmdlet on Azure version 5.1.2.  Can you please make sure you are running the latest "Azure" PowerShell module.  Please use 'Get-Module' to check the module version.
    Thursday, October 10, 2019 9:28 PM
  • I'm following up on this please let us know if there are anymore questions. In order to progress this issue forward, we will need you to reply/respond in regards to the replies above. Thanks
    Friday, October 25, 2019 10:56 PM
  • The azure service module where the Set-AzureVMMicrosoftAntimalwareExtension cmdlet comes from is not used for ARM deployments, it was for classic VMs only since it expects a servicename parameter which was replaced by the concept of resource groups in 2014. 

    There is no az powershell replacement as of yet. Use the azureRM module for now, check out this blog it worked for me. Basically the last line of his script is what you can sub your values in, theres no need to connect each time and do each vm one by one.

    https://charbelnemnom.com/2018/07/how-to-update-microsoft-antimalware-policies-for-azure-virtual-machines-with-powershell-arm-json-azuresecurity/

    • Proposed as answer by DiddelyDogg Friday, February 21, 2020 4:16 PM
    Friday, February 21, 2020 4:16 PM