I have a SQL Server with SSRS installed. Note that SQL runs as NT Service\MSSQLSERVER SSRS runs as NT SERVICE\SQLServerReportingServices Version: SQL Server 2017
I am trying to automate the backing up of the encryption. I have a batch file called rskey.bat that contains the following:
There is a file called "answer.yes" which contains only a "Y" as input for the "Are you sure you want to extract the key from the report server? Yes (Y)/ No (N): " question.
When I try and execute this batch file from SSMS with this:
exec xp_cmdshell 'C:\Backups\rskey.bat'
I get this error:
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
When I run the batch file manually, it works. I just cannot get it to work through SSMS even when running SSMS as administrator
I have made NT Service\MSSQLSERVER & NT SERVICE\SQLServerReportingServices admin on the server already and has necessary permissions on the folder.
For some context: I want this to work so that I can schedule the encryption key backups. I have this exact method running on all other SSRS servers without any issue. The only difference is that all other SSRS servers run the services as a domain account and not the virtual account NT Service\MSSQLSERVER
Could this be the reason? How can I get this to work without having the services running as a domain account?
Any ideas?
I ran Process Monitor and dug this out:
Thanks