Skip to content

Lakshmy/PBI_Scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Power BI Audit Scanner

Overview

PBI_Audit.ps1 performs a one-time tenant-wide audit of your Power BI environment using the Admin Scanner API. It discovers all workspaces in the tenant, scans them in batches of 100 (with lineage and datasource details enabled), and exports the results as flat CSV files and a raw JSON dump.

The script requires a Power BI admin account (Fabric Admin or Power BI Service Admin) and uses the MicrosoftPowerBIMgmt PowerShell module for authentication and REST calls.

How to Run

Prerequisites

  • PowerShell 5.1+ (Windows PowerShell or PowerShell 7)
  • A Power BI admin account (Fabric Admin or Power BI Service Admin role)
  • Internet access to reach the Power BI REST API

Steps

  1. Open a PowerShell terminal.
  2. Run the script:
    .\PBI_Audit.ps1
  3. If the MicrosoftPowerBIMgmt module is not installed, the script will install it automatically for the current user.
  4. A browser-based sign-in prompt will appear — authenticate with your admin account.
  5. The script will scan workspaces, poll for completion, and export results to a timestamped subfolder under output\ (e.g., output\2026-04-11_0810\). Each run creates a new subfolder so previous results are preserved.

Note: Scanning may take several minutes depending on the number of workspaces. Each batch has a 10-minute timeout.

Output Files

All files are saved to a timestamped subfolder under output\ (e.g., output\2026-04-11_0810\):

File Description
ScanRaw.json Complete raw JSON response from the Scanner API
Workspaces_All.csv All workspaces with ID, name, type, state, capacity info
Workspaces_ProShared.csv Workspaces not on dedicated/Premium capacity (Pro or shared)
Reports_All.csv All reports with workspace mapping, dataset ID, created/modified metadata
Datasets_All.csv All datasets with workspace mapping, configured by, and gateway ID
Dataset_Datasources.csv Datasource connection details per dataset (type, connection string, gateway)
Dataset_GatewayBindings.csv Datasets that are bound to an on-premises data gateway

About

Power BI tenant audit scanner using Admin Scanner API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors