Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 $token'; 'Content-type' = 'application/json'; 'User-Agent' = 'Jenkins'} -Body '{"principalType" = "Group", "groupUserAccessRight"= "Admin", "identifier"= "ID", "displayName"="MyGroupName"}'
I keep getting (400) Bad Request error. I am able to add individual users with this body:
{"groupUserAccessRight"= "Admin", "emailAddress"= "john@microsoft.com"}
What am I doing wrong to add groups?
EDIT: The problem seem to be the identifier number I am using. I am not sure how to retrieve the proper one though
Solved! Go to Solution.
Hi @TestCICD ,
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:
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.
Hi @TestCICD ,
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:
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.
The groups need to be mail enabled AD groups. The ID is the AD GUID of the group.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
5 | |
2 | |
2 |
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 |