Forum Discussion
API - Admin - Groups GetGroupsAsAdmin - can't get it to work
- 1 year ago
run a second call
$topn="%24top=5000"
$skip="%24skip=5000"
$Url = "https://api.powerbi.com/v1.0/myorg/admin/groups?$topn&$skip"
$uri = "https://api.powerbi.com/v1.0/myorg/admin/groups?$top=100"
...
$response = Invoke-PowerRestMethod -Url $uri -Method Get -headers $headers
Wrong uri format. If you use Invoke-PowerBIRestMethod (not Invoke-PowerRestMethod) then you are supposed to supply a relative URI "admin/groups/..."
- DerekLedbetter1 year agoFrequent Visitor
Thanks for the reply.
I've not been using - Invoke-PowerBIRestMethod (MicrosoftPowerBIMgmt.Profile) | Microsoft Learn.
I've been using - Invoke-RestMethod -Uri $Url -Method get -Headers $headersI did get it to work after going back to my original. The issue, is I have 9424 workspaces and need them all, not just the 5000.
- lbendlin1 year agoSuper User
use $top and $skip
- DerekLedbetter1 year agoFrequent Visitor
Thanks.
I have the documentation. However, I don't know how to write it in powershell using skip and top. Please note, I'm a beginner when it comes to API.