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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
IvanTrost
New Member

How to retrieve the users for my org's datasets

Hello, I'm trying to use this power bi api endpoint to retrieve the users permissions associated with datasets 

https://learn.microsoft.com/en-us/rest/api/power-bi/admin/datasets-get-dataset-users-as-admin

 

however there is an api limit of only 200 requests per hour, my organization has over 1200 datasets. It would take around 6 hours to just do a complete extract of all the user permissions for our datasets. This doesn't feel acceptable as it isn't scalable at all.

 

Is there some other way we are missing for extracting the user permissions for datasets? We are also running into this issue with other api endpoints and it is frustrating.

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @IvanTrost ,

You can use the Power BI PowerShell module if you want to avoid the limitation of 200 requests. You can install the module and use the Get-PowerBIWorkspace and Get-PowerBIDatasetUser cmdlets to retrieve the users for your organization's datasets. Here is an example of how to use the cmdlets:

Install-Module -Name MicrosoftPowerBIMgmt
Connect-PowerBIServiceAccount

$workspace = Get-PowerBIWorkspace -Name "YourWorkspaceName"
$dataset = Get-PowerBIDataset -WorkspaceId $workspace.Id -Name "YourDatasetName"
$users = Get-PowerBIDatasetUser -WorkspaceId $workspace.Id -DatasetId $dataset.Id

This will retrieve the users for the specified dataset in the specified workspace. You can also use the cmdlets to retrieve the users for all datasets in a workspace. Note that you'll need to have the Power BI PowerShell cmdlets installed and authenticated with your Power BI account before running this script. You can find more information on how to install and use the cmdlets in the following Power BI documentation.

Power BI Cmdlets reference | Microsoft Learn

Best Regards

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @IvanTrost ,

You can use the Power BI PowerShell module if you want to avoid the limitation of 200 requests. You can install the module and use the Get-PowerBIWorkspace and Get-PowerBIDatasetUser cmdlets to retrieve the users for your organization's datasets. Here is an example of how to use the cmdlets:

Install-Module -Name MicrosoftPowerBIMgmt
Connect-PowerBIServiceAccount

$workspace = Get-PowerBIWorkspace -Name "YourWorkspaceName"
$dataset = Get-PowerBIDataset -WorkspaceId $workspace.Id -Name "YourDatasetName"
$users = Get-PowerBIDatasetUser -WorkspaceId $workspace.Id -DatasetId $dataset.Id

This will retrieve the users for the specified dataset in the specified workspace. You can also use the cmdlets to retrieve the users for all datasets in a workspace. Note that you'll need to have the Power BI PowerShell cmdlets installed and authenticated with your Power BI account before running this script. You can find more information on how to install and use the cmdlets in the following Power BI documentation.

Power BI Cmdlets reference | Microsoft Learn

Best Regards

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

@v-yiruan-msft 


The term 'Get-PowerBIDatasetUser' is not recognized as the name of a cmdlet, function, script
file, or operable program.

Where did you find that command?  It doesn't exist.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.