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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AmilaGunawardan
Frequent Visitor

Get user list from shared Apps from Powerbi Rest API using Powershell

Hi,

 

I have tried to get all the users that have access to reports workspaces and Apps. Used the below code to get users that are in the workspace. But this code doesn't return the users that the dashboard shared as an APP. How should I get this information using Power BI REST API. Please help.

 

 

 

 

 

$Groups = Get-PowerBIWorkspace -All | SORT @{Expression="Type"; Descending=$True}, Name

##Get workspaces that are not deleted
$Groups = $Groups | SELECT Id, Name, Type, State | WHERE State -NE 'Deleted'
$GroupWorkspaces = $Groups | WHERE Type -eq 'Workspace'

##Make a global variable for keeping all the workspace information
$WorkspaceUsers = @()
## Clear variable for release all the session values
clear-variable -name WorkspaceUsers

##Start the looping statement for all workspaces
foreach ($GroupWorkspaceId in $GroupWorkspaces.Id) {
    #Retrieving workspace object from group id
    $WorkspaceObject = Get-PowerBIWorkspace -Id $GroupWorkspaceId
    $pbiURL = "https://api.powerbi.com/v1.0/myorg/groups/$GroupWorkspaceId/users"
#****************
#------------------------------------------------------
# --> API Call for WORKSPACE USERS  
#------------------------------------------------------ 
    ## API call for returning a list of users that have access to the specified workspace.
    $resultJson = Invoke-PowerBIRestMethod –Url $pbiURL –Method GET
)

 

 

 

 

 

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

Hi @AmilaGunawardan ,

 

The Admin - Apps GetAppUsersAsAdmin API returns a list of users that have access to the specified app.

Permissions:

  • The user must have administrator rights (such as Office 365 Global Administrator or Power BI Service Administrator) or authenticate using a service principal.
  • Delegated permissions are supported.

For more details, please refer to:

Admin - Apps GetAppUsersAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,

Jianbo Li

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

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @AmilaGunawardan ,

 

Yes, external users are also listed.

 

Best Regards,

Jianbo Li

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

AmilaGunawardan
Frequent Visitor

Hi @v-jianboli-msft ,

 

Thank you for the answer. From Admin - Apps GetAppUsersAsAdmin API does external users can be listed out too? Because my app has been shared to external users.

v-jianboli-msft
Community Support
Community Support

Hi @AmilaGunawardan ,

 

The Admin - Apps GetAppUsersAsAdmin API returns a list of users that have access to the specified app.

Permissions:

  • The user must have administrator rights (such as Office 365 Global Administrator or Power BI Service Administrator) or authenticate using a service principal.
  • Delegated permissions are supported.

For more details, please refer to:

Admin - Apps GetAppUsersAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.