After I clone an instance from an image, a few manual steps need to be carried out to get the report server working correctly. Among them is the deletion of all encrypted data, including symmetric key instances on the report server database.

This step requires me to RDP to the server in question, open the Reporting Services Configuration Manager and delete the encrypted data manually.

Without carrying out this step, I get the following error when I try to load up the report server interface of the new server:

The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable)

I'm trying to automate this step, so that it runs as part of a PowerShell script to remotely delete the encrypted data.

I am aware of 'rskeymgmt -d' but this prompts the user for input when run and has no force flag available to circumvent this additional input, rendering it unusable for running remotely as far as I can see:

C:\>rskeymgmt -d All data will be lost. Are you sure you want to delete all encrypted data from the report server database (Y/N)?

I've found a solutions to solving this problem. Calling RSKeyMgmt -d through a remote PowerShell session and piping the Y string to the call passes the parameter that RSKeyMgmt prompts the user for. This method is based on Som DT's post on backing up report server encryption keys

I've attached the full script I am using as part of my environment cloning process.

<# .SYNOPSIS Deletes encrypted content from a report server .PARAMETER MachineName The name of the machine that the report server resides on .EXAMPLE ./Delete-EncryptedSsrsContent.ps1 -MachineName 'dev41pc123' Deletes encrypted content from the 'dev41pc123' report server #> param([string]$MachineName = $(throw "MachineName parameter required, for command line usage of this script, type: 'get-help ./Delete-EncryptedSSRS.ps1 -examples'")) trap [SystemException]{Write-Output "`n`nERROR: $_";exit 1} Set-StrictMode -Version Latest try { Write-Output "`nCreating remote session to the '$machineName' machine now..." $session = New-PSsession -Computername $machineName Invoke-Command -Session $Session -ScriptBlock {"Y" | RSKeyMgmt -d} } catch { Write-Output "`n`nERROR: $_" } finally { if ($Session) { Remove-PSSession $Session } }

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

代码区博客精选文章
分页:12
转载请注明
本文标题:Deleting the report server &amp;lpar;native 2014&amp;rpar; Encrypted keys an ...
本站链接:https://www.codesec.net/view/628164.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(126)