Get-SqlColumnMasterKey

Gets the column master key objects defined in the database or gets one column master key object with the specified name.

Syntax

Get-SqlColumnMasterKey [[-Name] <String>] [-InputObject] <Database> [-Script]
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [<CommonParameters>]
Get-SqlColumnMasterKey [[-Name] <String>] [[-Path] <String>] [-Script] [-InformationAction <ActionPreference>]
 [-InformationVariable <String>] [<CommonParameters>]

Description

The Get-SqlColumnMasterKey cmdlet gets a column master key object for each column master key in the target database. If the name of the column master key is provided, the cmdlet returns one specific column master key object.

Examples

Example 1: Get all column master keys

PS C:\> Get-SqlColumnMasterKey

This command gets all column master keys from the database.

Example 2: Get a column master key with a specific name

PS C:\> Get-SqlColumnMasterKey -Name "CMK1"

This command gets a column master key named CMK1.

Parameters

-Name

Specifies the name of the column master key object.

Type:String
Required:False
Position:1
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
Required:True
Position:2
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Script

Indicates that this cmdlet runs a script to get the SQL column master key value.

Type:SwitchParameter
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
Aliases:infa
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Path

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

Type:String
Required:False
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

SqlColumnMasterKey[] or SqlColumnMasterKey