Restore‑SqlDscRSEncryptionKey - dsccommunity/SqlServerDsc GitHub Wiki
Restores the encryption key for SQL Server Reporting Services.
Restore-SqlDscRSEncryptionKey -Configuration <Object> -Path <String> -Password <SecureString>
[-Credential <PSCredential>] [-DriveName <String>] [-PassThru] [-Force]
[-WhatIf] [-Confirm] [<CommonParameters>]
Restores the encryption key for SQL Server Reporting Services or
Power BI Report Server by calling the RestoreEncryptionKey method
on the MSReportServer_ConfigurationSetting CIM instance.
This command restores a previously backed up encryption key to the report server. This is required after migrating to a new server or in disaster recovery scenarios to decrypt stored credentials and connection strings in the report server database.
The configuration CIM instance can be obtained using the
Get-SqlDscRSConfiguration command and passed via the pipeline.
$password = Read-Host -AsSecureString -Prompt 'Enter backup password'
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Restore-SqlDscRSEncryptionKey -Path 'C:\Backup\RSKey.snk' -Password $password
Restores the encryption key from a local file.
$password = ConvertTo-SecureString -String 'MyP@ssw0rd' -AsPlainText -Force
$config = Get-SqlDscRSConfiguration -InstanceName 'SSRS'
Restore-SqlDscRSEncryptionKey -Configuration $config -Path '\Server\Share\RSKey.snk' -Password $password -Credential (Get-Credential) -Force
Restores the encryption key from a UNC path with credentials and without confirmation.
$password = Read-Host -AsSecureString -Prompt 'Enter backup password'
Get-SqlDscRSConfiguration -InstanceName 'SSRS' | Restore-SqlDscRSEncryptionKey -Path 'C:\Backup\RSKey.snk' -Password $password -PassThru
Restores the encryption key and returns the configuration CIM instance.
Specifies the MSReportServer_ConfigurationSetting CIM instance for
the Reporting Services instance.
This can be obtained using the
Get-SqlDscRSConfiguration command.
This parameter accepts pipeline
input.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseSpecifies the credentials to use when accessing a UNC path. Use this parameter when the Path is a network share that requires authentication.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the name of the temporary PSDrive to create when accessing a UNC path with credentials. Defaults to 'RSKeyRestore'. This parameter can only be used together with the Credential parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: RSKeyRestore
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, suppresses the confirmation prompt.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, returns the configuration CIM instance after restoring the encryption key.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the password that was used when backing up the encryption key.
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the full path to the encryption key backup file (.snk).
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
The Reporting Services service may need to be restarted after restoring the encryption key.