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
Anonymous
Not applicable

Power BI REST API Powershell - Help with GetReportUsersAsAdmin

I am trying to use the REST API to return the Users of the report.   I have no problem getting the command to return a list of users for a report using the following in Power shell. 

 

Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/admin/reports/{reportId}/users" -Method Get

 

But I need to run this for several report ids.  The above command will accept a value in a collection as long as the collection has only one entry.   For example if I set $ReportID = "enter id value" and then run Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/admin/reports/$ReportID/users" -Method Get  it works.   However, as stated before I need to do this for several IDs.  

 

I've tried running $ReportIDs = @(Get-PowerBIReport -Scope Organization|Select ID)

Then running the following Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/admin/reports/$ReportIDs/users"  but this errors out. 

 

Please help.  

2 REPLIES 2
mariussve1
Solution Sage
Solution Sage

Hi,

I think you then need to use the foreach function in Powershell
ex:

 

$ReportID = "1","2","3","4","5","6"    (Here you can put a rest API to get all id'es as well)

foreach($item in $list)

{

    #Do stuff

    Invoke-PowerBIRestMethod -Url urlpart/$ReportID/users

}

I have not testet it, so its just to give you an example.


Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Anonymous
Not applicable

Thanks for replying, with some help, I got the for each loop in place, but now the results returned are pretty much useless.  They don't export in any useable or readable format.   Tried using format function and ConvertFrom in order to export them but that's where I'm stuck now. 

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.