Forum Discussion
Bulk Assign Workspace Capacity
Is there a way I can assign multiple workspaces to a capacity at one time? I have approximately users in multiple countries and I have capacities based on each country. I want to take all users from a specific country and assign them to their respective country. Country isn't something tracked in a personal workspace, but I do have all the names and countries in a spreadsheet.
Hi taran42
You can bulk assign the workpsaces.
- I would first get the capacity ID's. Get Capacities As Admin
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-capacities-as-admin
take the specific Capacity ID you want to assign the workspaces to. - Then get the workpsace ID's and map to your excel document.
Groups GetGroupsAsAdmin
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-groups-as-admin - When you have the workspace ID's and specific Capacity to which you want to assign the workspaces, use the Admin - Capacities AssignWorkspacesToCapacity to assign the workspaces in bulk.
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/capacities-assign-workspaces-to-capacity
replace the CapacityID and WorkspacesID's in the script below
{
"capacityMigrationAssignments": [
{
"targetCapacityObjectId": "CapacityID",
"workspacesToAssign": [
"WorkspaceID1"
,"WorkspaceID2"
,...
]
}
]
}
- I would first get the capacity ID's. Get Capacities As Admin
5 Replies
- blopez11Super User
Yes, if you have the Fabric Administrator role, previously Power BI Administrator role, you can do this in the Admin portal > Workspaces. Select multiple workspaces, then select Reassign workspace.
- taran42Advocate I
Hi blopez11, thank you for the reply. I can do it like this, but I do not know which users belong to which country by just looking in the Workspace list. The Workspace list in the admin settings only shows John Smith. Not that John Smith is in the US. My Excel sheet shows John Smith and that he is in the US. Is there a way to change the Fabric capacity for multiple users at one time by using input from another document (such as an Excel sheet)?
- Wikkleyn_81Super User
Hi taran42
You can bulk assign the workpsaces.
- I would first get the capacity ID's. Get Capacities As Admin
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-capacities-as-admin
take the specific Capacity ID you want to assign the workspaces to. - Then get the workpsace ID's and map to your excel document.
Groups GetGroupsAsAdmin
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-groups-as-admin - When you have the workspace ID's and specific Capacity to which you want to assign the workspaces, use the Admin - Capacities AssignWorkspacesToCapacity to assign the workspaces in bulk.
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/capacities-assign-workspaces-to-capacity
replace the CapacityID and WorkspacesID's in the script below
{
"capacityMigrationAssignments": [
{
"targetCapacityObjectId": "CapacityID",
"workspacesToAssign": [
"WorkspaceID1"
,"WorkspaceID2"
,...
]
}
]
}
- I would first get the capacity ID's. Get Capacities As Admin
- blopez11Super User
Maybe you can write a powershell script that uses your excel file and the power bi cmdlets to reassign workspace capacities: https://learn.microsoft.com/en-us/rest/api/power-bi/capacities/groups-assign-to-capacity
- SaiTejaTalasilaSuper User
Hi,
Hi,
Hi,
You can use activity logs (audit logs) and your company's employee table it contains office 365 profile details create a relationship between 2 tables or apply join (you can check with your tenant admin) to identify the maximum number of users from each country. From this, you can decide.