Description
openedon May 10, 2019
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I am getting this error when attempting to restore an encryption key on a remote system using an alternate credential:
Failed to restart Report Server database service. Manually restart it for the change to take effect! Cannot find any service with service name 'ReportServer'.
Restore-RSEncryptionKey
does not properly handle restarting of the Reporting Services service when run from a remote system and using an alternate credential. The function incorrectly assumes that the user running the command has appropriate access to the Reporting Services system. This is reflected through the use of Get-Service
, which does allow connecting to another system but not with alternate credentials:
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Assuming that adminuser
user has access to the computer SSRS and the user running the command does not, this will fail:
Restore-RSEncryptionKey -KeyPath 'C:\MyFolder\MyKeyFile.snk' -Password 'MyPass' -ComputerName SSRS -Credential (Get-Credential adminuser)
What is the expected behavior?
The function should handle situations with and without an alternate credential.
Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
Windows 10 Enterprise 1803 with PowerShell 5.1.