Forum Discussion
How can I programmatically add or remove users for a Power BI dataset, given the following scenario?
Gow_tham to my knowledge there are no Rest API's or XMLA approaches to add users / members to a RLS role. It is possible to create Roles dynamically using semantic-link python library but the members cannot be added to or removed form the roles created. The best option is to have a security group for each role, but you stated it is out of scope in your current project. Not sure about the powershell route.
Did I answer your question. If yes, please accept my post as a solution.
Thanks,
Jai
Thanks Jai-Rathinavel
After checking out the community forums and talking to some MVPs, it looks like there aren't any REST APIs or PowerShell cmdlets to add users to a role programmatically (like you said). I've added this idea to the PowerBI Ideas forum. Meanwhile, I'm working on convincing my IT team/administrators to use security groups for different roles in the dataset and manage access that way. I have a PowerShell script that can add users to a security group from a CSV file. If you know any other easy ways to add users to a security group, let me know!
Cheers,
Gowtham