< Back

Set-AzureServiceAntimalwareExtension

Wed Jan 30, 2019 5:53 pm

NAME Set-AzureServiceAntimalwareExtension



SYNOPSIS

Configures the Microsoft Antimalware extension for cloud services.





SYNTAX

Set-AzureServiceAntimalwareExtension [-ServiceName] <String> [[-Slot] <String>] [[-Role] <String[]>] [[-AntimalwareConfiguration] <XmlDocument>]

[[-Monitoring] <String>] [[-StorageContext] <AzureStorageContext>] [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>]

[-InformationVariable <String>] [<CommonParameters>]





DESCRIPTION

The Set-AzureServiceAntimalwareExtension cmdlet configures the Microsoft Antimalware extension for a cloud service. You can specify values that override

and supplement values in the XML configuration, such as the storage account context.





PARAMETERS

-ServiceName <String>

Specifies the name of the cloud service.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Slot <String>

Specifies a deployment slot. Valid values are:



-- Production



-- Staging





The default value is Production.





Required? false

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Role <String[]>

Specifies an array of roles. The default value is all roles.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-AntimalwareConfiguration <XmlDocument>

Specifies an XmlDocument object that contains the Microsoft Antimalware configuration. This object must not be $Null or empty. The configuration

object must include, at a minimum, the following content to enable the Microsoft Antimalware extension:



<AntimalwareConfig><AntimalwareEnabled>true</AntimalwareEnabled></AntimalwareConfig>



Required? false

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Monitoring <String>

Specifies whether to collect Microsoft Antimalware events. Valid values are:



-- ON. Collect Microsoft Antimalware events to storage context.



-- OFF. Do not collect Microsoft Antimalware events.



Required? false

Position? 4

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-StorageContext <AzureStorageContext>

Specifies an Azure storage context for Microsoft Antimalware monitoring.



Required? false

Position? 5

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Enable the extension --------------------------



PS C:\\> [System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument

PS C:\\> $XmlConfig.load('C:\\configuration\\contosoVM.xml')

PS C:\\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03" -AntimalwareConfiguration $XmlConfig

Operation succeeded



The first two commands create an XmlDocument object that contains a configuration for the Microsoft Antimalware extension, and then stores it in the

$XmlConfig variable.

-------------------------- Example 2: Enable the extension for the Staging slot --------------------------



PS C:\\> [System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument

PS C:\\> $XmlConfig.load('C:\\configuration\\contosoVM.xml')

PS C:\\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03" -Slot "Staging" -AntimalwareConfiguration $XmlConfig

Operation succeeded



The first two commands create an XmlDocument object that contains a configuration for the Microsoft Antimalware extension, and then stores it in the

$XmlConfig variable.

-------------------------- Example 3: Enable the extension with monitoring --------------------------



PS C:\\>System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument

PS C:\\> $XmlConfig.load('C:\\configuration\\contosoVM.xml')

PS C:\\> $StorageContext = New-AzureStorageContext -StorageAccountName "contosostoragemain" -StorageAccountKey (Get-AzureStorageKey -StorageAccountName

"Contosostoragemain").Primary

PS C:\\> Set-AzureServiceAntimalwareExtension -ServiceName "ContosoService03" -AntimalwareConfiguration $XmlConfig -Monitoring ON -StorageContext

$StorageContext



The first two commands create an XmlDocument object that contains a configuration for the Microsoft Antimalware extension, and then stores it in the

$XmlConfig variable.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=402843

Get-AzureServiceAntimalwareConfig

Remove-AzureServiceAntimalwareExtension