New-SqlBackupEncryptionOption

Creates the encryption options for the Backup-SqlDatabase cmdlet or the Set-SqlSmartAdmin cmdlet.

Syntax

New-SqlBackupEncryptionOption
   [-NoEncryption]
   [-Algorithm <BackupEncryptionAlgorithm>]
   [-EncryptorType <BackupEncryptorType>]
   [-EncryptorName <String>]
   [<CommonParameters>]

Description

The New-SqlBackupEncryptionOption cmdlet creates the encryption options for the Backup-SqlDatabase cmdlet or the Set-SqlSmartAdmin cmdlet.

Examples

Example 1: Create encryption options

PS C:\> $EncryptionOption = New-SqlBackupEncryptionOption -Algorithm Aes256 -EncryptorType ServerCertificate -EncryptorName "BackupCert"

This command creates the encryption options and stores the result in the variable named $EncrytionOption

Parameters

-Algorithm

Specifies the encryption algorithm.

Type:BackupEncryptionAlgorithm
Accepted values:Aes128, Aes192, Aes256, TripleDes
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EncryptorName

Specifies the name of the server certificate or server asymmetric key.

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

-EncryptorType

Specifies the encryptor type.

Type:BackupEncryptorType
Accepted values:ServerCertificate, ServerAsymmetricKey
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoEncryption

Indicates that this cmdlet disables encryption. This parameter cannot be used with any other parameters.

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

Outputs

Microsoft.SqlServer.Management.Smo.BackupEncryptionOptions

This cmdlet is used as input to the EncryptionOption parameter for the Backup-SqlDatabase and Set-SqlSmartAdmin cmdlets.