Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-AzureServiceAntimalwareExtension

Set-AzureServiceAntimalwareExtension

microsoft.windowsazure.commands.servicemanagement.dll

Synopsis

Configures the Microsoft Antimalware extension for cloud services.

Syntax

Set-AzureServiceAntimalwareExtension [-ServiceName] [-Slot] [-Role] [-AntimalwareConfiguration] [-Monitoring] [-StorageContext] [<CommonParameters>]

Set-AzureServiceAntimalwareExtension [-ServiceName] [-Slot] [-Role] [-AntimalwareConfiguration] [-Monitoring] [-StorageContext] [<CommonParameters>]

Detailed 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 storage account context.

Parameters

-ServiceName <String>

Specifies the name of the cloud service.

Aliases

None

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.

Aliases

None

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.

Aliases

None

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>

Aliases

None

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.

Aliases

None

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.

Aliases

None

Required?

false

Position

5

Default value

none

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

Examples

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

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.

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

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

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.

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

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

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.

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

Online Version
New-AzureStorageContext
Get-AzureServiceAntimalwareConfig
Remove-AzureServiceAntimalwareExtension