Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all!
I have a workspace to which more than 500 users who have access.
Now i need to remove all users except the 2 admin users
Is there a way to remove the access of all users (or atleast multiple users) from workspace instead of removing access for each user one by one as below?Removing access of each user in this method is time consuming.
Is there any Power BI REST API command to remove the access of all users (or atleast multiple users) at one go?
Appreciate any response.
TIA!
Solved! Go to Solution.
Hi. I'm not sure how many users you have exactly but yes. You need to loop the users at workspaces. If you have a list of 500 that you are sure they shouldn't be at workspaces then yes. Loop the 500 removing them from workspaces. That's the only way to build the login in a script for now. The API won't allow batch delete of many users at the same time.
This is why using office or azure AD groups is so important. If you have your company properly organized by groups you can just remove the group.
I hope that helps,
Happy to help!
Hi @ibarrau
Thanks for your reply.
Do you suggest i have to programmatically call the DELETE API in a loop 500+ times to delete each user?
Kindly clarify
Hi. I'm not sure how many users you have exactly but yes. You need to loop the users at workspaces. If you have a list of 500 that you are sure they shouldn't be at workspaces then yes. Loop the 500 removing them from workspaces. That's the only way to build the login in a script for now. The API won't allow batch delete of many users at the same time.
This is why using office or azure AD groups is so important. If you have your company properly organized by groups you can just remove the group.
I hope that helps,
Happy to help!
Hi! the request from the API that you can use is the DELETE a user from GROUP. The thing is that you need to specify de workspace id and the user. So you might need to build a nice logic for your script.
The following request is the one you can use: https://docs.microsoft.com/en-us/rest/api/power-bi/groups/delete-user-in-group
You can use PowerShell cmdlets or SimplePBI python lib if you want to keep the use of the API simpler.
I hope that helps,
Happy to help!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.