Complete-SqlColumnMasterKeyRotation

SYNOPSIS

Completes the rotation of a column master key.

SYNTAX

ByObject

Complete-SqlColumnMasterKeyRotation -SourceColumnMasterKeyName <String> [-InputObject] <Database> [-Script]
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]

ByPath

Complete-SqlColumnMasterKeyRotation -SourceColumnMasterKeyName <String> [[-Path] <String>] [-Script]
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]

DESCRIPTION

The Complete-SqlColumnMasterKeyRotation cmdlet completes the process of replacing an existing column master key with a new, target, column master key for the Always Encrypted feature. The cmdlet gets all column encryption key objects containing encrypted key values that are encrypted with the specified source column master key. The cmdlet then updates each column encryption key object to remove the entry for an encrypted value that was produced using the specified column master key. As a result, each impacted column encryption key object will have only one encrypted value entry, produced using the column master key that is the target of the rotation.

EXAMPLES

Example 1: Complete the process of rotating the column master key

PS C:\> Cleanup-SqlColumnMasterKey -SourceColumnMasterKeyName "CMK1"

This command completes the process of rotating the column master key named CMK1.

PARAMETERS

-SourceColumnMasterKeyName

Specifies the name of the source column master key.

Type: String
Parameter Sets: (All)
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

Specifies the SQL database object for which this cmdlet runs the operation.

Type: Database
Parameter Sets: ByObject
Aliases: 

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Script

Indicates that this cmdlet runs a script to complete the rotation of a column master key.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-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
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InformationVariable

Specifies an information variable.

Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Specifies the path to the SQL database, for which this cmdlet runs the operation. If you do not specify a value for the parameter, the cmdlet uses the current working location.

Type: String
Parameter Sets: ByPath
Aliases: 

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

NOTES

Configure Always Encrypted using PowerShell

Invoke-SqlColumnMasterKeyRotation