New-SqlColumnEncryptionSettings

Creates a SqlColumnEncryptionSettings object that encapsulates information about a single column's encryption, including CEK and encryption type.

语法

Default (默认值)

New-SqlColumnEncryptionSettings
    [-ColumnName] <String>
    [-EncryptionType] <String>
    [[-EncryptionKey] <String>]
    [<CommonParameters>]

说明

The New-SqlColumnEncryptionSettings cmdlet creates a SqlColumnEncryptionSettings object. The SqlColumnEncryptionSettings object encapsulates information about the Always Encrypted settings for a single database columns, including the encryption type and the column encryption key.

Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.

示例

Example 1: Create an encrypted SqlColumnEncryptionSettings object for a column

PS C:\> $EncryptionSettings = New-SqlColumnEncryptionSettings dbo.Person.LastName "Deterministic" MyCEK

This command creates a SqlColumnEncryptionSettings object for the column named dbo.Person.LastName, specifying the deterministic encryption and column encryption key named MyCEK for the column. The command stores the result in the variable named $EncryptionSettings.

Example 2: Create an unencrypted SqlColumnEncryptionSettings object for a column

PS C:\> $EncryptionSettings = New-SqlColumnEncryptionSettings dbo.Person.FirstName "Plaintext"

This command creates a SqlColumnEncryptionSettings object for the dbo.Person.FirstName column, specifying the column is not encrypted. The command stores the result in the variable named $EncryptionSettings.

参数

-ColumnName

Specifies the name of the database column that uses the following format: [<schemaName>.]<tableName>.<columnName>.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-EncryptionKey

Specifies the name of the column encryption key object. This argument is not allowed if the EncryptionType parameter value is set to Plaintext.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:2
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-EncryptionType

Specifies the type of encryption. The acceptable values for this parameter are:

  • Deterministic, for deterministic encryption
  • Randomized, for randomized encryption
  • Plaintext, indicating that the column is not encrypted.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

输出

SqlColumnEncryptionSettings