Forum Discussion

IainR65's avatar
IainR65
New Member
2 years ago

Get Power BI Capacity info

What's the best way to get PowerBI Workspace, Report and Dataset Information through Powershell? I've already got the activity through get-powerbiactivityevent , so I don't need anything from that cmdlet, I just need to list Workspaces, reports and datasets etc. I've already created the following script, however I'd also like to know where to get information such as the name, id and email addresses of the workspace and report owners.

Here's a script I've already created, which gets me workspace and Report info:

 

Connect-PowerBIServiceAccount

$logpath = 'C:\scripts\pbilog.csv'
$Workspaces = Get-PowerBIWorkspace -Scope Organization -All| Where-Object {$psitem -notlike "PersonalWorkspace*"}
$Reports =
ForEach ($workspace in $Workspaces)
{
#Write-Host $workspace.Name
ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))
{
[pscustomobject]@{
WorkspaceID = $workspace.Id
WorkspaceName = $workspace.Name
ReportID = $report.Id
ReportName = $report.Name
ReportURL = $report.WebUrl
ReportDatasetID = $report.DatasetId
}
}
}

$Reports | Export-Csv -Path $logpath -NoTypeInformation

 

 

1 Reply