< Back

Set-AzureRmSqlDatabaseDataMaskingPolicy

Tue Jan 29, 2019 10:10 pm

NAME Set-AzureRmSqlDatabaseDataMaskingPolicy



SYNOPSIS

Sets data masking for a database.





SYNTAX

Set-AzureRmSqlDatabaseDataMaskingPolicy [-ResourceGroupName] <String> [-ServerName] <String> [-DatabaseName] <String> [-DataMaskingState {Enabled

| Disabled}] [-DefaultProfile <IAzureContextContainer>] [-PassThru] [-PrivilegedLogins <String>] [-PrivilegedUsers <String>] [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The Set-AzureRmSqlDatabaseDataMaskingPolicy cmdlet sets the data masking policy for an Azure SQL database. To use this cmdlet, use the

ResourceGroupName , ServerName , and DatabaseName parameters to identify the database. You can set the DataMaskingState parameter to specify

whether data masking operations are enabled or disabled.



You can also set the PrivilegedLogins parameter to specify which users are allowed to see the unmasked data. If the cmdlet succeeds and the

PassThru parameter is used, it returns an object describing the current data masking policy in addition to the database identifiers. Database

identifiers include, but are not limited to, ResourceGroupName , ServerName , and DatabaseName .



This cmdlet is also supported by the SQL Server Stretch Database service on Azure.





PARAMETERS

-DatabaseName <String>

Specifies the name of the database where the policy is set.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DataMaskingState <String>

Specifies whether data masking operation is enabled or disabled. The acceptable values for this parameter are:



- Enabled



- Disabled





The default value is Enabled.





Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PrivilegedLogins <String>

Specifies which SQL users are excluded from masking.



This parameter is deprecated and will be removed from future releases.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PrivilegedUsers <String>

Specifies a semicolon-separated list of privileged user IDs. These users are allowed to view the masking data.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

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



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

Specifies the name of the server hosting the database.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

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 (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Sql.Security.Model.DatabaseDataMaskingPolicyModel







NOTES









Example 1: Set the data masking policy for a database



PS C:\\>Set-AzureRmSqlDatabaseDataMaskingPolicy -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01

-PrivilegedUsers "public" -DataMaskingState "Enabled"



This command sets the data masking policy for a database named database01 on the server named server01.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... kingpolicy

Get-AzureRmSqlDatabaseDataMaskingPolicy

Get-AzureRmSqlDatabaseDataMaskingRule

New-AzureRmSqlDatabaseDataMaskingRule

Remove-AzureRmSqlDatabaseDataMaskingRule

Set-AzureRmSqlDatabaseDataMaskingRule

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/