Adding a user with a role to an SSRS report
In this recipe, we will add a user with a few roles to SSRS.
Getting ready
In this recipe, we will add QUERYWORKS\aterra
as a browser and Content Manager to the Customer Contact Numbers report.
For your environment, instead of using QUERYWORKS\aterra
, you can identify a user you want to add to an existing report, and which roles you want to assign to them.
How to do it...
Open the PowerShell console by going to Start | Accessories | Windows PowerShell | Windows PowerShell ISE.
Add the following script and run:
$ReportServerUri = "http://localhost/ReportServer/ReportService2010.asmx" $proxy = New-WebServiceProxy -Uri $ReportServerUri -UseDefaultCredential $type = $Proxy.GetType().Namespace $itemPath = "/Customers/Customer Contact Numbers" #this will hold all the groups/users for a report $newPolicies = @() $inherit = $null #list current report users $proxy.GetPolicies($itemPath, [ref]$inherit) #NOTE that when we change policies, it will #automatically...