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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
viswaaa
Helper II
Helper II

Get list of all workspaces

Hi All,

 

As an Admin how do I know who has access to which workspaces and also which reports ?

Also, how do I see all the workspaces and delete if not required and also the respected owners list and also the reports they published to these workspaces and also how to remove them in the future if they leave the organization and report is no longer needed.

1 ACCEPTED SOLUTION

Hi @viswaaa ,

you can refer the below document related to Power BI REST API :
https://learn.microsoft.com/en-us/rest/api/power-bi/

View solution in original post

11 REPLIES 11
viswaaa
Helper II
Helper II

Hi All,

 

I can see all the workspaces and I need to see what reports are uploaded in those work spaces and how I can delete them if needed.

Pease suggest

Hi @viswaaa ,

  • To view the reports available in a workspace, navigate to the Workspaces section. Once inside a specific workspace, you'll find different tabs such as Dashboards, Reports etc..
  • Click on the Reports tab to see all the reports stored within that workspace.
  • If you need to remove a report, locate it under the Reports tab and use the available options to delete it.

You can prefer the below screenshot

vaatheeque_2-1741764808635.png

Reference : Delete a dashboard, report, workbook, semantic model, or workspace - Power BI | Microsoft Learn

If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

If you continue to face issues, feel free to reach out to us for further assistance!

Regards
aatheeque

Hi @viswaaa ,

we wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

If our response has addressed your query, please accept it as a solution so that other community members can find it easily.

Hi ,

Could you please let mw know how I can do below things using rest API

Like where I need to run and the code

 

  • Power BI REST API:
    • Use GetGroupsAsAdmin to list workspaces.
    • Use GetGroupUsersAsAdmin to get users and roles.

Hi @viswaaa ,

you can refer the below document related to Power BI REST API :
https://learn.microsoft.com/en-us/rest/api/power-bi/

Hi @viswaaa ,

If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @viswaaa ,

we wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

If our response has addressed your query, please accept it as a solution so that other community members can find it easily.

Assuming you have everything else set up (service principle, permissions etc.). 

 

PowerShell to get all workspaces:

Install-Module -Name MicrosoftPowerBIMgmt

Connect-PowerBIServiceAccount

Get-PowerBIWorkspace -Scope Organization -All -Include All| ConvertTo-Json -Depth 10 | Out-file C:\Workspaceuser.txt

 

Python to get all workspaces:

#########################################################################################
# Authentication - Replace string variables with your relevant values       
#########################################################################################

import json, requests, pandas as pd
try:
    from azure.identity import ClientSecretCredential
except Exception:
     !pip install azure.identity
     from azure.identity import ClientSecretCredential

# --------------------------------------------------------------------------------------#
# String variables: Replace with your own
tenant = 'Your-Tenant-ID'
client = 'Your-App-Client-ID'
client_secret = 'Your-Client-Secret-Value' # See Note 2: Better to use key vault
api = 'https://analysis.windows.net/powerbi/api/.default'
# --------------------------------------------------------------------------------------#

# Generates the access token for the Service Principal
auth = ClientSecretCredential(authority = 'https://login.microsoftonline.com/',
                                                        tenant_id = tenant,
                                                        client_id = client,
                                                        client_secret = client_secret)
access_token = auth.get_token(api)
access_token = access_token.token

print('
Successfully authenticated.')   

#########################################################################################

# Note 1: This code was authored for use in a Google Colab Notebook
# Note 2: Check here for info on using Azure Key Vault: 
          # https://docs.microsoft.com/en-us/azure/key-vault/secrets/quick-create-python    
          # The above code should be modified to programmatically get the secret from AKV

#########################################################################################
# Admin: Get all Workspaces only - see Gist for all workspaces + expand 
#########################################################################################

base_url = 'https://api.powerbi.com/v1.0/myorg/'
header = {'Authorization': f'Bearer {access_token}'}

# The admin API doesn't work unless you provide a ?$top=n argument
# Top 5000 workspaces
topn = '$top=5000'

# Get workspaces only
admin_groups = f'{base_url}admin/groups?{topn}'

# HTTP GET Request
groups = requests.get(admin_groups, headers=header)

# Response code (200 = Success; 401 = Unauthorized; 404 = Bad Request)
print(groups)
try:
    groups = json.loads(groups.content)

except Exception as e:
    print(e)
    exit()

#########################################################################################
# Return the results in dataframes
#########################################################################################

try:
    result = pd.concat([pd.json_normalize(x) for x in groups['value']])
    print('Found', len(result['id'].dropna().unique().tolist()), 'workspaces.')
except Exception:
    print('No workspaces found.')
v-aatheeque
Community Support
Community Support

Hi @viswaaa ,

Thanks for reaching out to the Microsoft Fabric Community forum.

@andrewsommer @lbendlin  Thanks for your prompt response. In addition to that let me add some more insights :

To list all workspaces, users, and their roles:

  • Power BI Admin Portal:
    • Go to Admin Portal > Workspaces.
    • Click Access on each workspace to see users and roles.
  • Power BI REST API:
    • Use GetGroupsAsAdmin to list workspaces.
    • Use GetGroupUsersAsAdmin to get users and roles.

 If our response addressed by the community member for  your query, please mark it as Accept Answer and click Yes if you found it helpful.

 

Should you have any further questions, feel free to reach out.

Thank you for being a part of the Microsoft Fabric Community Forum!
 

andrewsommer
Super User
Super User

There are a variety of ways to go about this but the best is using the Power BI REST API to pull whatever you want.  You can get your workspaces and reports plus a whole lot more. 

https://docs.microsoft.com/en-us/rest/api/power-bi/

lbendlin
Super User
Super User

Workspaces in Power BI - Power BI | Microsoft Learn

 

Also read about the Tenant Audit Reports and about Purview (if applicable)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.