Forum Discussion
viswaaa
Helper IV
1 year agoIdentify reports uploaded by an user to workspaces
Hi All, We are the Power BI admins, and I need some assistance. One of our users, who had uploaded a large number of reports to a workspace, has left the organization. As an admin, I would like to k...
- 1 year ago
Use the REST API to see what is going on in the service.
Reports - REST API (Power BI Power BI REST APIs) | Microsoft LearnIf you need to remove reports that are no longer needed just navigate to that workspace and delete them (if you are a workspace admin).
Power BI doesn’t have an explicit "ownership" field that controls access—artifact management is governed by workspace role assignments.Promote/assign other users as Workspace Admins
- Go to the workspace.
- Add new users as Admins or Members so they can manage or republish the report.
Please mark this post as a solution if it helps you. Appreciate Kudos.
JMLyle
Advocate I
1 year agoI tried to grab something out of one of my PowerShell scripts to target your question, but it may not be exactrly what you're looking for. It may need a little tweaking of course. Requires Power BI Admin role, I believe.
Import-Module MicrosoftPowerBIMgmt.Workspaces
Connect-PowerBIServiceAccount
$AllWorkspaces = Get-PowerBIWorkspace -Scope Organization -All
Foreach ($Workspace in $AllWorkspaces) {
Write-Host $("Workspace ID: {0,-36} Workspace Name: {1,-170}" -F $Workspace.ID, """$($Workspace.Name)""") -BackgroundColor White -ForegroundColor Black
$ReportObjectsForThisWorkspace = Get-PowerBIReport -Scope Organization -WorkspaceId $Workspace.Id
ForEach ($Report in $ReportObjectsForThisWorkspace) {
# Write-Host $( " Report ID: {0,-36} Report Name: {1,-60} " -F $Report.ID, """$($Report.Name)""") -BackgroundColor Cyan -ForegroundColor Black
Foreach ($DatasetId in $Report.DatasetId) {
$RetryWait = 0
Write-Progress -Id 420 -Activity "Get-PowerBIDataset" -Status "Getting Dataset" -CurrentOperation "DatasetId: $DatasetId"
Do {
Try {
$Dataset = Get-PowerBIDataset -Id $DatasetId -Scope Organization -ErrorAction Stop
$RetryWait = 0
}
Catch {
$CaughtError = $_
If ($CaughtError -match 'TooManyRequests') {
$RetryWait = $RetryWait + 30
Write-Progress -Id 420 -Activity "Get-PowerBIDataset" -Status "CAUGHT Error - TooManyRequests - Sleep for $RetryWait seconds"
Start-Sleep -Seconds $RetryWait
}
Else {
"CAUGHT some other error - $CaughtError"
$RetryWait = 0
Write-Progress -Id 420 -Activity "Get-PowerBIDataset" -Status "CAUGHT some other error - $CaughtError"
}
}
}
Until($RetryWait -eq 0)
# $Dataset = Get-PowerBIDataset -Id $DatasetId -Scope Organization
$DatasetCreatedText = If ($Dataset.CreatedDate) { $("Created: {0:MM/dd/yyyy}" -F $Dataset.CreatedDate) }Else { 'details unavailable' }
$ConfiguredByUpn = If ($Dataset.ConfiguredBy) { "ConfiguredBy: $($Dataset.ConfiguredBy)" }Else { '' }
$RefreshableText = If ($Dataset.IsRefreshable) { "Refreshable" }Else { "" }
$GatewayText = If ($Dataset.IsOnPremGatewayRequired) { "via Gateway" }Else { "" }
Write-Host $( " Report ID: {0,-36} Report Name: {1,-50} Dataset ID: {2} {3,-19} {4,-50} {5,-11} {6,-11} " -F $Report.ID, """$($Report.Name.TrimEnd())""",$dataset.id,$DatasetCreatedText,$ConfiguredByUpn,$RefreshableText,$GatewayText) -BackgroundColor Cyan -ForegroundColor Black
# Write-Host $( " Dataset ID: {0,-36} Dataset Name: {1,-60} {2,-19} {3,-50} {4,-11} {5,-11} " -F $Dataset.ID, """$($Dataset.Name)""", $DatasetCreatedText, $ConfiguredByUpn, $RefreshableText, $GatewayText) -BackgroundColor DarkYellow -ForegroundColor Black
Write-Progress -Id 420 -Completed
}
}
}