When you manage Power BI environments — especially in larger organizations with hundreds of workspaces and multiple semantic models — auditing who has access to which dataset can quickly become a manual, tedious task. Power BI’s admin portal is powerful, but drilling into every workspace and dataset to fetch user permissions isn’t efficient.
To solve this, I built a PowerShell script that automates the extraction of dataset access details — saving time, reducing errors, and enabling repeatable access reporting.
Why This Script Matters
Power BI datasets can be shared across workspaces and users with different roles and permissions. Knowing exactly who has access to what is crucial for:
- Security reviews
- Audit readiness
- Workspace migrations
- Governance insights
Previously, gathering this data meant clicking through the admin portal, exporting results manually, or writing a mix of REST API calls in short-lived scripts. This tool turns that process into a quick, consistent workflow.
What the Script Does
Here’s how the script simplifies the workflow:
- Authenticates to the Power BI service using your credentials
- Retrieves all workspaces you have access to
- Prompts you to select a workspace
- Lists all semantic models (datasets) inside that workspace
- Prompts you to select a dataset
- Retrieves the dataset’s access list via the Power BI REST API
- Converts the JSON API response into PowerShell objects
- Exports the results to a CSV file with a timestamped filename
This gives you a structured, exportable list of users and their access rights — perfect for audit logs or documentation.
Tech Stack
The script combines:
- PowerShell
- Power BI REST API
- The
Invoke-PowerBIRestMethodcmdlet - CSV export for easy analytics
These technologies make it easy to integrate into existing PowerShell-based workflows and automate further if needed.
How to Use It
- Open PowerShell
- Navigate to the folder where the script is stored
- Run:
.\extract-powerbi-dataset-users.ps1
- Follow the prompts in the console to select the workspace and dataset
When done, you’ll find a CSV file in the same folder with user access details and a timestamp — ready for analysis or compliance reporting.
Get the Script
You can download the script from GitHub: https://github.com/dinu-noroc/Public/blob/main/extract-powerbi-dataset-users.ps1
Final Thoughts
If you’re responsible for governance, security, or compliance within Power BI, having an automated way to extract user access from datasets isn’t just convenient — it’s essential.
Let me know if you want enhancements — like exporting role names, filtering by access level, or scheduling this script to run regularly!
Happy reporting! 🚀