Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Microsoft Power BI Service and Desktop / Reports
Microsoft Windows PowerShell
Executing the PowerShell cmdlet Export-PowerBIReport we receive the below mention error message
Export-PowerBIReport : Operation returned an invalid status code 'Unauthorized'
At E:\Scripts\pbiExportPowerBIReport.ps1:2 char:1
+ Export-PowerBIReport -Id f74199d0-20e3-4946-9764-a80f60a5541c -OutFil ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...rtPowerBIReport:ExportPowerBIReport) [Export-PowerBIReport], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'Unauthorized',Microsoft.PowerBI.Commands.Reports.ExportPowerBIReport
This can be caused for several reasons:
Export-PowerBIReport -Id <Power BI Report ID> -OutFile 'D:\my.pbix2' |
This script is missing the WorkspaceID parameter. If the report does not exist in the My Workspace workspace, then this will return the 'Unauthorized' error message. |
Export-PowerBIReport -Id <Power BI Report ID> -WorkspaceId <Invalid Workspace ID> -OutFile 'D:\my.pbix2' |
If either the Report ID (-id) and/or the Workspace ID (-Workspaceid) is invalid, the 'Unauthorized' error message will be returned. |
Export-PowerBIReport -Id <Power BI Report ID> -WorkspaceId <Power BI Workspace ID> -OutFile 'D:\my.pbix2' |
If you did not upload the PBIX file from Power BI Desktop to the Power BI Service, and there is no PBIX file associated, then the 'Unauthorized' error message will be returned.
|
To resolve this issue, you need to ensure the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.