Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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.
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
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.