Use-​Azure​Rm​Sql​Server​Auditing​Policy

Specifies that a database uses the auditing policy of its host server.

Syntax

Use-AzureRmSqlServerAuditingPolicy
   [-ResourceGroupName] <String>
   [-ServerName] <String>
   [-DatabaseName] <String>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-PassThru]
   [<CommonParameters>]

Description

The Use-AzureRmSqlServerAuditingPolicy cmdlet specifies that a database uses the auditing policy of its host server. Specify the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. If no auditing policy is defined for the database server, this cmdlet fails.

If the host uses server level auditing, threat detection is removed.

Examples

Example 1: Configure a database to use the auditing policy of its server

PS C:\>Use-AzureRmSqlServerAuditingPolicy -ResourceGroupName "ResourceGroup01" -ServerName "Server02" -DatabaseName "Database01"

This command specifies that the database named Database01 on Server02 uses the auditing policy of the server.

Required Parameters

-DatabaseName

Specifies the name of the database that will use the auditing policy.

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

Specifies the name of the resource group to which the server is assigned.

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

Specifies the name of the server that hosts the database that uses the auditing policy.

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

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
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

Outputs

Microsoft.Azure.Commands.Sql.Security.Model.DatabaseAuditingPolicyModel