Skip to content
Rishan Solutions
Rishan Solutions
  • PowerApps
  • SharePoint online
    • Uncategorized
    • Uncategorized
  • PowerAutomate
Rishan Solutions
Latest Posts
  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025 June 24, 2025
  • Recursive Queries in T-SQL May 7, 2025
  • Generating Test Data with CROSS JOIN May 7, 2025
  • Working with Hierarchical Data May 7, 2025
  • Using TRY_CAST vs CAST May 7, 2025
  • Dynamic SQL Execution with sp_executesql May 7, 2025

Exporting Power BI Report Metadata Using PowerShell

Posted on March 24, 2025March 24, 2025 by Rishan Solutions

Loading

Exporting Power BI report metadata helps administrators track and manage reports, datasets, workspaces, and user access efficiently. This guide will walk you through how to retrieve and export Power BI report metadata using the MicrosoftPowerBIMgmt PowerShell module.


Step 1: Prerequisites

1. Install and Import the Power BI PowerShell Module

Ensure that the Power BI PowerShell module is installed:

# Install the Power BI module (if not installed)
Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser -Force

# Import the module
Import-Module MicrosoftPowerBIMgmt

2. Authenticate to Power BI

Before retrieving report metadata, connect to Power BI:

# Connect interactively
Connect-PowerBIServiceAccount

For automation, use a Service Principal:

# Define credentials
$clientId = "your-client-id"
$clientSecret = "your-client-secret"
$tenantId = "your-tenant-id"

# Convert secret to secure string
$secureSecret = ConvertTo-SecureString $clientSecret -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($clientId, $secureSecret)

# Connect using Service Principal
Connect-PowerBIServiceAccount -ServicePrincipal -TenantId $tenantId -ClientId $clientId -Credential $credential

Now you’re connected to Power BI!


Step 2: Retrieve Power BI Report Metadata

To get metadata for all reports, use:

# Get all reports and their metadata
$reports = Get-PowerBIReport -All

# Display metadata details
$reports | Select-Object Id, Name, WebUrl, DatasetId, WorkspaceId, ModifiedDate

Example Output

Id                                   Name              WebUrl                        DatasetId                               WorkspaceId                           ModifiedDate
------------------------------------ ---------------- ----------------------------- ------------------------------------ ------------------------------------ --------------
abcd1234-5678-90ef-ghij Sales Report https://app.powerbi.com/reports/abcd1234 efgh5678-1234-90kl-mnop wxyz9876-5432-10ab-cdef 2024-03-15

You now have Power BI report metadata!


Step 3: Retrieve Report Metadata for a Specific Workspace

To retrieve metadata for a specific workspace, first get the workspace ID:

# Define workspace name
$workspaceName = "Sales Analytics"

# Get workspace details
$workspace = Get-PowerBIWorkspace -Name $workspaceName

# Retrieve report metadata for the workspace
$reports = Get-PowerBIReport -WorkspaceId $workspace.Id

# Display metadata
$reports | Select-Object Id, Name, WebUrl, DatasetId, ModifiedDate

Report metadata for the specific workspace retrieved!


Step 4: Retrieve Additional Metadata (Datasets, Owners, etc.)

To get dataset details linked to reports:

# Get all datasets
$datasets = Get-PowerBIDataset -All

# Display dataset metadata
$datasets | Select-Object Id, Name, WebUrl, IsRefreshable, ModifiedDate

To get report owners and access details:

# Get report access details
$reports | ForEach-Object {
Get-PowerBIReportUser -ReportId $_.Id
}

You now have complete metadata including datasets and ownership details!


Step 5: Export Report Metadata to CSV

To save report metadata to a CSV file:

$reports | Export-Csv -Path "C:\PowerBI_Report_Metadata.csv" -NoTypeInformation

For datasets metadata:

$datasets | Export-Csv -Path "C:\PowerBI_Datasets_Metadata.csv" -NoTypeInformation

Metadata exported successfully!


Step 6: Disconnect from Power BI

Once done, disconnect from Power BI:

Disconnect-PowerBIServiceAccount
Posted Under PNP PowerShellDataset Management Microsoft 365 Power Bi Power BI Admin Power BI API Power BI Automation Powershell Report Metadata

Post navigation

Basic syntax of jQuery
Managing Power BI Dashboard Access using PowerShell

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025
  • Recursive Queries in T-SQL
  • Generating Test Data with CROSS JOIN
  • Working with Hierarchical Data
  • Using TRY_CAST vs CAST

Recent Comments

  1. Michael Francis on Search , Filter and Lookup in power apps
  2. A WordPress Commenter on Hello world!

Archives

  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • March 2024
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • January 2022

Categories

  • Active Directory
  • AI
  • AngularJS
  • Blockchain
  • Button
  • Buttons
  • Choice Column
  • Cloud
  • Cloud Computing
  • Data Science
  • Distribution List
  • DotNet
  • Dynamics365
  • Excel Desktop
  • Extended Reality (XR) – AR, VR, MR
  • Gallery
  • Icons
  • IoT
  • Java
  • Java Script
  • jQuery
  • Microsoft Teams
  • ML
  • MS Excel
  • MS Office 365
  • MS Word
  • Office 365
  • Outlook
  • PDF File
  • PNP PowerShell
  • Power BI
  • Power Pages
  • Power Platform
  • Power Virtual Agent
  • PowerApps
  • PowerAutomate
  • PowerPoint Desktop
  • PVA
  • Python
  • Quantum Computing
  • Radio button
  • ReactJS
  • Security Groups
  • SharePoint Document library
  • SharePoint online
  • SharePoint onpremise
  • SQL
  • SQL Server
  • Template
  • Uncategorized
  • Variable
  • Visio
  • Visual Studio code
  • Windows
© Rishan Solutions 2025 | Designed by PixaHive.com.
  • Rishan Solutions