Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Need help in exporting Database name, Server Name, Dataset, Report Name and Workspace Name using PowerShell.
Can someone help me with the script?
Solved! Go to Solution.
$Workspaces = Get-PowerBIWorkspace -All
$Reports = ForEach ($workspace in $Workspaces) {
Write-Host $workspace.Name
ForEach ($report in (Get-PowerBIReport -WorkspaceId $workspace.Id)) {
ForEach ($datasource in (Get-PowerBIDatasource -DatasetId $report.DatasetId)) {
[pscustomobject]@{
WorkspaceID = $workspace.Id
WorkspaceName = $workspace.Name
ReportID = $report.Id
ReportName = $report.Name
DatasetID = $report.DatasetId
DataSourceName = $datasource.name
ConnectionString = $datasource.ConnectionString
ConnectionServer = $datasource.ConnectionDetails.Server
ConnectionDatabase = $datasource.ConnectionDetails.Database
ConnectionUrl = $datasource.ConnectionDetails.Url
GatewayID = $datasource.GatewayId
Datasoruceid = $datasource.DatasourceId
}
}
}
}
$Reports | Export-Csv -Path <mention path> -NoTypeInformation
Hi
Need to extract the data using Powershell scripts.
Is it possible to get Database name, Server Name, Report Name and Workspace Name using Powershell script?
or Can we get list of Power BI report, workspace which are using specific datasource?
$Workspaces = Get-PowerBIWorkspace -All
$Reports = ForEach ($workspace in $Workspaces) {
Write-Host $workspace.Name
ForEach ($report in (Get-PowerBIReport -WorkspaceId $workspace.Id)) {
ForEach ($datasource in (Get-PowerBIDatasource -DatasetId $report.DatasetId)) {
[pscustomobject]@{
WorkspaceID = $workspace.Id
WorkspaceName = $workspace.Name
ReportID = $report.Id
ReportName = $report.Name
DatasetID = $report.DatasetId
DataSourceName = $datasource.name
ConnectionString = $datasource.ConnectionString
ConnectionServer = $datasource.ConnectionDetails.Server
ConnectionDatabase = $datasource.ConnectionDetails.Database
ConnectionUrl = $datasource.ConnectionDetails.Url
GatewayID = $datasource.GatewayId
Datasoruceid = $datasource.DatasourceId
}
}
}
}
$Reports | Export-Csv -Path <mention path> -NoTypeInformation
Hi @ajaquib
You can get this if you set up the scanner API, here is a blog post explaining how to get this done
https://powerbi.tips/2021/10/using-the-power-bi-scanner-api-to-manage-tenants-entire-metadata/
User | Count |
---|---|
47 | |
31 | |
28 | |
27 | |
26 |
User | Count |
---|---|
58 | |
55 | |
36 | |
33 | |
28 |