Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi All,
I am trying to add user in workspace from PowerShell script which works but if a user is already a member of it, it will fail. What I am trying to achieve is whatever latest information I provide should be followed i.e. if user was admin previously & in new script run, if it is degraded to viewer then that should work. I am using "Add-PowerBIWorkspaceUser" to achieve this, but it is failing with error :
Add-PowerBIWorkspaceUser : Operation returned an invalid status code 'BadRequest'
Any ideas?
Thanks in advance!
Max
Solved! Go to Solution.
Hi. Well the method says Add. So I guess it only adds. I'm not familiarized with power bi cmdlets, but I haven't seen a way to solve this using only that. However I know the API, it would let you build a script to fix it. You can try catch the exception and try an update of the user like the doc
https://learn.microsoft.com/en-us/rest/api/power-bi/groups/update-group-user
That request let you update a user permission at a workspace.
I hope that helps,
Happy to help!
Hi. Well the method says Add. So I guess it only adds. I'm not familiarized with power bi cmdlets, but I haven't seen a way to solve this using only that. However I know the API, it would let you build a script to fix it. You can try catch the exception and try an update of the user like the doc
https://learn.microsoft.com/en-us/rest/api/power-bi/groups/update-group-user
That request let you update a user permission at a workspace.
I hope that helps,
Happy to help!
This helps a lot, I can build a solution on this. Thanks!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 24 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |