Update-AzSqlServerAdvancedThreatProtectionSettings

Sets a advanced threat protection settings on a server.

Syntax

Update-AzSqlServerAdvancedThreatProtectionSettings
      [-PassThru]
      [-NotificationRecipientsEmails <String>]
      [-EmailAdmins <Boolean>]
      [-ExcludedDetectionType <String[]>]
      [-StorageAccountName <String>]
      [-RetentionInDays <UInt32>]
      -ServerName <String>
      [-ResourceGroupName] <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Update-AzSqlServerAdvancedThreatProtectionSettings cmdlet sets a advanced threat protection settings on an Azure SQL server. In order to enable advanced threat protection on a server an auditing settings must be enabled on that server. To use this cmdlet, specify the ResourceGroupName and ServerName parameters to identify the server.

Examples

Example 1: Set the advanced threat protection settings for a database

PS C:\>Update-AzSqlServerAdvancedThreatProtectionSettings -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -NotificationRecipientsEmails "admin01@contoso.com;secadmin@contoso.com" -EmailAdmins $False -ExcludedDetectionType "Sql_Injection_Vulnerability","SQL_Injection" -StorageAccountName "mystorageAccount"

This command sets the advanced threat protection settings for a server named Server01.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EmailAdmins

Specifies whether the advanced threat protection settings contacts administrators by using email.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ExcludedDetectionType

Specifies an array of detection types to exclude from the settings. The acceptable values for this parameter are:

  • Sql_Injection
  • Sql_Injection_Vulnerability
  • Access_Anomaly
  • None
Type:System.String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NotificationRecipientsEmails

Specifies a semicolon-separated list of email addresses to which the settings sends alerts.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group to which the server belongs.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RetentionInDays

The number of retention days for the audit logs

Type:System.Nullable`1[System.UInt32]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServerName

Specifies the name of the server.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageAccountName

Specifies the name of the storage account to be used. Wildcards are not permitted. This parameter is not required. When this parameter is not provided, the cmdlet will use the storage account that was defined previously as part of the advanced threat protection settings of the database. If this is the first time a database threat detection settings is defined and this parameter is not provided, the cmdlet will fail.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType[]

System.Nullable`1[[System.UInt32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

Outputs

Microsoft.Azure.Commands.Sql.ThreatDetection.Model.ServerThreatDetectionsettingsModel