question

mjvr avatar image
mjvr asked

How to add SSRS users and permissions programmatically

Good day

I've read a few articles online but I cannot find a solution. I have SSRS users that are going to be migrated to another domain and they require access to the same SSRS reports once the migration is completed.

Example, user AbbyA on domain ABCD is going to be migrated to domain EFGH.

Old domain\username: ABCD\AbbyA

New domain\username: EFGH\AbbyA

I have the following code which allows me to see what reports users currently have access too:


select C.UserName, D.RoleName, D.[Description] [Description], E.[Path] [Path], E.[Name] [Name]

from [ReportServer].[dbo].[PolicyUserRole] A

inner join [ReportServer].[dbo].[Policies] B on A.PolicyID = B.PolicyID

inner join [ReportServer].[dbo].[Users] C on A.UserID = C.UserID

inner join [ReportServer].[dbo].[Roles] D on A.RoleID = D.RoleID

inner join [ReportServer].[dbo].[Catalog] E on A.PolicyID = E.PolicyID

where C.UserName = 'ABCD\AbbyA'


Can this be done via SQL Management Studio? Most of the articles I've read suggests that it cannot be done via SQL Management Studio, please do advise what my options are?


ssrspermissionsusersdomains
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered

Only way would be to look to hit the REST API and do it programmatically that way, otherwise you need to do it all via the SSRS web page

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjvr avatar image mjvr commented ·

Hi, thanx for your reply. Could you please elaborate on how it would be done programmatically?

0 Likes 0 ·
anthony.green avatar image anthony.green mjvr commented ·

https://social.msdn.microsoft.com/Forums/en-US/10898072-c6c9-430d-a67d-45716b03e763/permissions-on-new-ssrs-users-with-rest-api


The bottom gives a powershell example on how to invoke the rest method to add permissions.

After that you're going to need to look at the different rest methods SSRS publishes and find the right ones which meet your needs.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.