Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
vijaykvs
Microsoft Employee
Microsoft Employee

Unauthorized error when trying to export report using Powershell command Export-PowerBIReport

I am trying to export pbix report to my local machine. I have admin access on the workspace and am able to list the reports. However, I'm getting "unauthorized..." error while trying to export the report. Appreciate any help here.

 

Here is the code I'm using

Connect-PowerBIServiceAccount

Export-PowerBIReport -Id XXXXX -WorkspaceId XXXXX -OutFile .\ExportReportByPowershell.pbix -Verbose

 

Error Message:

Export-PowerBIReport : Operation returned an invalid status code 'Unauthorized'
At line:12 char:3
+ Export-PowerBIReport -Id $reportId -WorkspaceId $workspace.Id -OutF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...rtPowerBIReport:ExportPowerBIReport) [Export-PowerBIReport], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'Unauthorized',Microsoft.PowerBI.Commands.Reports.ExportPowerBIReport

VERBOSE: Request Uri: https://api.powerbi.com/v1.0/myorg/groups/xxxxx/reports/xxxxx/Export
VERBOSE: Status Code: Unauthorized (401)

 

1 ACCEPTED SOLUTION

Download a report from the Power BI service to Power BI Desktop - Power BI | Microsoft Learn

Limitations when downloading a report .pbix file

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

There's a long list of restrictions when it comes to PBIX download.  Validate that your scenario is not covered by that list.

Can you please share those requirements with me. I didn't see much in the documentation. Thanks!

Download a report from the Power BI service to Power BI Desktop - Power BI | Microsoft Learn

Limitations when downloading a report .pbix file

That worked, thank you. Going by the error, I was wondering if there was a limitation with accessing the report. I see that the Large Semantic Model was set on the report. I am able to export after turning that off.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.