Thanks for bearing with me! First blog post of 2026, lets just say I have been busy! To start us off, I have another PowerShell script I put together the end of last year, a way to search for PowerBI parameters with PowerShell.
When running:
- multiple workspaces
- with multiple reports
- all with multiple parameters
Sometimes, it seems you need an easy solution to find where you have set parameters to specific items.
My use case for example, I have a number of reports pointing to a specific data source. When migrating that data source I wanted to discover which reports where still attached so this script made it super simple!
How it works?
This PowerShell script, similar to a few of my others will loop through all the PowerBI workspaces you have access to, and at the same time loop through every report and parameter, logging where it finds the defined parameter as it goes.
The parameters endpoint for every dataset makes it simple to find this information and we can simply loop through each. It will naturally log results in a custom object showing the:
- Workspace Name
- Report Name
- Parameter Name
- Current Parameter Value
- Dataset ID
What do you need to modify?
This is one is a real simple one, just change the searchValue to the actual value of the parameter itself you want to discover, for example
Parameter Name : Source
Parameter Value : SQLDB1
So in this case we search for SQLDB1
So hopefully this will help you! It certainly saved a huge amount of time for me! code below!
Connect-PowerBIServiceAccount
# The value you are searching for
$SearchValue = "Domain"
$workspaces = Get-PowerBIWorkspace -All
Write-Host "Starting Scan" -ForegroundColor Yellow
$Results = $workspaces | ForEach-Object -Parallel {
$Target = $using:SearchValue
$workspace = $_
try {
# Get reports in this workspace
$Reportlist = Get-PowerBIReport -WorkspaceId $workspace.Id
foreach ($Report in $Reportlist) {
if (-not $Report.DatasetId) { continue }
# Fetch parameters for the dataset
$Url = "https://api.powerbi.com/v1.0/myorg/groups/$($workspace.Id)/datasets/$($Report.DatasetId)/parameters"
$resp = Invoke-PowerBIRestMethod -Url $Url -Method Get
$params = (ConvertFrom-Json $resp).value
foreach ($p in $params) {
if ($p.currentValue -eq $Target) {
Write-Host "[MATCH] Workspace: $($workspace.Name)" -ForegroundColor Cyan
Write-Host " Report: $($Report.Name)" -ForegroundColor White
Write-Host " Parameter: $($p.name)" -ForegroundColor Green
# Collect in Object
[PSCustomObject]@{
Workspace = $workspace.Name
Report = $Report.Name
ParameterName = $p.name
ParameterValue = $p.currentValue
DatasetId = $Report.DatasetId
}
}
}
}
} catch {
# Skip datasets that cannot be accessed
}
} -ThrottleLimit 8
if ($Results) {
$Results | Out-GridView -Title "Search Results: Parameter Value '$SearchValue'"
} else {
Write-Host "No reports found with parameter value: $SearchValue" -ForegroundColor Red
}
