Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
misterMethod
Frequent Visitor

Using PowerShell to add AD Security Group to Workspace.

HI All,
     I am trying Add Active Directory Security Group to workspace using PowerShell. 
I can do it manually ( I am Global Admin on the tenant)
I can add specific user using the PowerShell cmdlet "ADD-PowerBIWorkspaceUser -id <workspaceId> -UserEmailAddress - <UserPrincipalName> - AccessRight <AccessRight>" 
The issue is when I try using th same command to Add AD Security Group (Email enabled) I get an error saying 

Here is the cmdlet.
Add-PowerBIWorkspaceUser -Scope Organization -Id  <WorkspaceId> -Identifier <AD Group GUI> -AccessRight Viewer -PrincipalType Group

Add-PowerBIWorkspaceUser: Operation returned an invalid status code 'BadRequest'
and using the Resolve-PowerBIError cmdlet 
I get "InvalidRequest","message":"Parameter PrincipalType or Identifier is missing or invalid"
I am wondering if there is something I am missing.
P.S. On V2 workspace. Using connect-PowerBIServiceAccount to connect to the powerbi.com.

Thanks in advance.

2 REPLIES 2
misterMethod
Frequent Visitor

@v-zhangti  Thanks, for the suggestion.. It is clear I could use API call to achieve the same.. But  for that you need to have a service principal. I would like to know is if the add-PowerBIWorkspaceUser does not support adding AD Group or is there something I am missing.

Thanks.

v-zhangti
Community Support
Community Support

Hi, @misterMethod 

 

Please refer to the following links in the hopes of helping you.

Solved: How can I add a Azure Security group to Power BI W... - Microsoft Power BI Community

Solved: PowerShell - Adding Power BI user in workspace - Microsoft Power BI Community

Add Bulk Users to Office 365 Group with PowerShell - MorganTechSpace

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors