March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I finally got my powershell script working to call the Power BI rest methods to extract all workspaces and reports in workspaces.
But What I am missing is the the endorsement labels for each report. Does anyone know how I can modify this script get that info?
Any help would be appreicated.
# need to set this to ensure proper connections
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# import modules and login
Import-Module MicrosoftPowerBIMgmt
Import-Module MicrosoftPowerBIMgmt.Profile
Connect-PowerBIServiceAccount
# initialize variables
$uriGroups = 'https://api.powerbi.com/v1.0/myorg/groups'
Write-Host "******* Reading Workspaces *****"
try {
$workSpacesJson = Invoke-PowerBIRestMethod -Url $uriGroups -Method Get
$workspaceContents = $workSpacesJson | ConvertFrom-Json
$workspaceCount = $workspaceContents.value.count
$workspaces = $workspaceContents.value
Write-Host "Total workspaces:" $workspaceCount
# loop thru the workspaces and get the reports
foreach ($workspace in $workspaces) {
$uriReports = $uriGroups + "/" + $workspace.id + "/reports?$expand=endorsementDetails"
$reportsJson = Invoke-PowerBIRestMethod -Url $urireports -Method Get
$reportsContents = $reportsJson | ConvertFrom-Json
$reportsCount = $reportsContents.value.count
#$reports = $reportsContents.value
Write-Host "Total reports in workspace:" $reportsCount
Write-Host "******* Exporting workspaces to json file *****"
$ExportFile = "./export/Reports_"+$workspace.name+".json"
$reportsJson | Out-File $ExportFile
}
if (-Not $?) {
$errmsg = Resolve-PowerBIError -Last
$errmsg.Message
}
} catch {
$errmsg = Resolve-PowerBIError -Last
$errmsg.Message
}
Write-Host "******* Exporting workspaces to json file *****"
$ExportFile = "./export/WorkSpaces.json"
$workSpacesJson | Out-File $ExportFile
Disconnect-PowerBIServiceAccount
Solved! Go to Solution.
here's one of the ideas around that. Says "Needs Votes" 🙂
Microsoft Idea · Report Endorsement (powerbi.com)
Picking up on an old topic, but since it is now possible to endorse both Dataset and Reports in the Power BI service can someone explain why this endorse information is not possible to retrieve via the Power BI Rest API???
@v-shex-msft responded to another thread similar to this but it seems this has also been dropped Microsoft Idea (powerbi.com)
It looks like the API documentation is still incorrect. EndorsementDetails are not returned by Get Report or Get Reports in Group.
here's one of the ideas around that. Says "Needs Votes" 🙂
Microsoft Idea · Report Endorsement (powerbi.com)
I think this is one of these rare cases where the documentation is ahead of the implementation. I am sure the API team is working on updating that call's return structure.
Thanks for the input @lbendlin . Do you know if there is an idea out there for this or another location where I can post the request to the API team?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
9 | |
3 | |
2 | |
2 | |
2 |