Forum Discussion

mavhernandez's avatar
mavhernandez
Regular Visitor
3 years ago

Remove security AAD groups from Workspace

I've been working on simple automation like adding aad users to aad groups and pbi workspaces. I can add users to workspace , even add groups to workspaces but I cannot remove the groups, although I can remove the users from the workspaces. I've been searching for a week now, but no-one came close. Did anyone figure out how to approach this through Powershell? thanks

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mavhernandez ,

     

    As far as I know, we can remove the group or users from workspcae access.

    This function works well in my side, I can remove the security gourp scuccessfully.

    Or you can try to remove the user by Power BI Rest API.

    For reference: Groups - Delete User In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    This API call can be called by a service principal profile. For more information see: Service principal profiles in Power BI Embedded.

     

    Best Regards,
    Rico Zhou

     

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

     

    • mavhernandez's avatar
      mavhernandez
      Regular Visitor

      Thanks Rico Zhou,
      UI interaction also works for me. For the REST API not really much experience in that department yet, a sample how to execute it in python / powershell would be really great. I've  seen some sample on the internet however, there were nothing that removes the AAD security group from the workspace.

      Below is a sample of my ADD to workspace approach

      and below is the one I am working on with PowerShell but no luck