ReportingServices - Calling SetRoleProperties directly

Peter Bishop 161 Reputation points
2023-05-10T10:24:56.54+00:00

I have a requirement to block users from accessing SSRS at certain times of the day (during overnight processing) but need SSRS to be running in the normal way since overnight processing includes running subscriptions.

I had a thought to create custom roles for these users and at the relevant time of day call the "SetRoleProperties" procedure for this purpose. However, that doesn't make the changes take effect! Looking at a profiler trace when using SSMS and unticking the options in the GUI (which does work) I also see a call to "UpdatePolicy" which I assume applies the values which have been made. However I can't find a way to build the parameters for this stored procedure.

Has anyone found a way to programmatically update the permissions assigned to a role in SSRS?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,878 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AniyaTang-MSFT 12,421 Reputation points Microsoft Vendor
    2023-05-11T01:50:56.6466667+00:00

    Hi @Peter Bishop

    I'm sorry I don't know much about programming, but I found this link for you about managing SSRS security with PowerShell: https://www.sqlshack.com/managing-ssrs-security-using-powershell-automation-scripts/.

    But for more details on programming, I recommend that you go to the relevant tag or platform for help.

    Hope this can help you.

    Best regards,

    Aniya