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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

PowerShell Login to Power BI - Write Error

Hi All,

I'm attempting to login to Power BI through the PowerShell Power BI cmdlet.. I was able to install the cmdlet (Install-Module -Name MicrosoftPowerBIMgmt) however when trying to login I recieve a WriteError (shown below).. When using "Connect-PowerBIServiceAccount" or "Login-PowerBI" the login screen for my organization comes up and I login using my credentials.. Howver then PowerShell returns the WriteError.

Since the image is kinda hard to read here is the error:
Login-PowerBIServiceAccount : One or more errors occurred.
At line:1 char:1
+ Login-PowerBIServiceAccount
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-PowerBIServiceAccount], AggregateException
    + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount

--

It seems most of the WriteErrors in similar posts occured in steps subsequent to logging in. 

I do have a Pro license and Premium capacity available if that's also relevant. I'm attempting to return the access token for Power BI Embedded using PowerShell as described here.

 

I'm a PowerShell novice so I appreicate any guidance.

Thanks!PowerShell Error.JPG

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi there

I would suggest you install ALL the Power BI Modules. And can you confirm the version you have installed is 1.0.830?

They are:
MicrosoftPowerBIMgmt.Admin
MicrosoftPowerBIMgmt.Capacities
MicrosoftPowerBIMgmt.Data
MicrosoftPowerBIMgmt.Profile
MicrosoftPowerBIMgmt.Reports
MicrosoftPowerBIMgmt.Workspaces




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

5 REPLIES 5
Icey
Community Support
Community Support

Hi @Anonymous ,

 

I can't reproduce your issue.

 

1. Please check.

Supported environments and PowerShell versions:

  • Windows PowerShell v3.0 and up with .NET 4.7.1 or above.
  • PowerShell Core (v6) and up on any OS platform supported by PowerShell Core.

 

2. Install Profile module for Power BI Cmdlets.

Install-Module -Name MicrosoftPowerBIMgmt.Profile

 

3. Run as Administrator and try to login to Power BI.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

GilbertQ
Super User
Super User

Hi there

I would suggest you install ALL the Power BI Modules. And can you confirm the version you have installed is 1.0.830?

They are:
MicrosoftPowerBIMgmt.Admin
MicrosoftPowerBIMgmt.Capacities
MicrosoftPowerBIMgmt.Data
MicrosoftPowerBIMgmt.Profile
MicrosoftPowerBIMgmt.Reports
MicrosoftPowerBIMgmt.Workspaces




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi Team,

 

Can you advise if "Connect - Power BI account" cmdlet while used with service principal will still ask for MFA prompt ? We are trying to setup a mechanism where we want to keep MFA enabled for org security, but figure a way to automate fetching Power BI logs through this account. Please let me know how can this be setup.

Anonymous
Not applicable

That seemed to work! I was able to retrieve the embed token.

I did run into a snag when then trying that embed token in the Microsoft Power BI Embedded Playground for whatever the reason when trying to run using one of my own reports it wouldn't render at all in the embed view in the lower part of the page.

The steps being:

-Switch to AAD token
-Paste embed token from PowerShell
-Paste Embed URL (from report)
-Past Report ID
-Hit Run

From there no results, not even anything showing up on the log on the right of that screen.

Does the report need to be registered in Azure as an app first? Which I also tried and didn't have anymore luck. 

Hi there

Yes you would have to create an App with the permissions to Power BI in Azure Active Directory.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.