Forum Discussion
Update to Power BI report server version May 2019 breaks PowerShell role update script
After upgrading to the May 2019 version of Power BI report server my PowerShell scripts that updates the role security for folders fails to add/modify the user role.
I created a csv file with the roles I need to assign to an AD group and my script updates these roles based on the values in the csv file. This worked before the upgrade and now I am receiving an error and it won't update new security if it has multiple values: i.e. Browser Content Manager, Publisher
3 Replies
- d_gosbell
Super User
Can you post the script (or at least the part of the script that throws the error) as well as the details of the error message that you recieve?
- JimTheBIGuy
Helper I
Here's a section of the script that grants rights to the AD group.
TRY{
Write-Host "Granting Rights for $strIdentity"
Grant-RsCatalogItemRole -Identity $strIdentity -RoleName $strRole -Proxy $proxy -Path $strPath
}
CATCH{
Write-Host "Error in granting rights for: $strIdentity" -foregroundcolor Red
}It seems like it works if it's only one role but when you have multiples you get the error.
- d_gosbell
Super User
Hmm, I was just looking at the source code for that function and it looks like the roles parameter only expects a single role name. I can't see anything that would handle multiple roles
Have you tried printing the content of the actual error? If you do a
WRITE-HOST $_
the $_ variable inside the catch block will hold the actual error message thrown by the Grant-RsCatalogItemRole cmdlet which should give you more information on what is going wrong here