Forum Discussion
Anonymous
3 years agoNot applicable
Unable to add groups to a workspace using Rest API
l need to use powershell to add a group to an existing workspace Invoke-RestMethod -Method POST -Uri "https://api.powerbi.com/v1.0/myorg/groups/<groupId>/users" -Header @{Authorization = 'Bearer ...
- 3 years ago
Hi Anonymous ,
With PowerShell, you can add an AD group to Power BI Workspace using the Groups – Add Group User API or Add-PowerBIWorkspaceUser Cmdlet.
What you will need:
- Object ID for the group
- From Azure Active Directory -> Select Groups -> Select the required Group -> Copy the Object ID
- Access right to the Workspace for the group
- Level of Access you want to grant to the Workspace (
Member, Admin, Contributor, Viewer )
- Level of Access you want to grant to the Workspace (
- The PrincipalType
- The type of Principal you want to add (
App, Group, User ) For this example, we want to add an AD Security Group, so we will use Group
- The type of Principal you want to add (
- The Workspace ID
- From Power BI Service -> Select the Workspace -> copy the ID next to Group in the URL.
For more details, please refer to:
ADDING AZURE AD SECURITY GROUP TO POWER BI WORKSPACE USING POWERSHELL - Ruki's Blog
Power BI Group management using Active Directory roles and PowerShell
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Object ID for the group
lbendlin
3 years agoSuper User
The groups need to be mail enabled AD groups. The ID is the AD GUID of the group.