Forum Discussion

mbutler71's avatar
mbutler71
Advocate I
4 years ago
Solved

Get-PowerBICapacity Doesn't Work

Has anybody gotten this to work in PowerShell?

$caps = Get-PowerBICapacity -Scope Organization;

I've tried with my account, I'm a Capacity Admin, a service principal, and a generic account that has been added to the Capacity admins and contributors. 

Thanks for any insight. 
  • Hey kerski,

    You have to login first before you can run the command. So your Power Shell should look like this:

    Login-PowerBIServiceAccount 
    Get-PowerBICapacity -Scope Individual

     This is as long as you are using the regular public enivronment for Power BI (Non-government cloud).

3 Replies

  • I have the issue too: 

     

    Get-PowerBICapacity : Login first with Login-PowerBIServiceAccount
    At line:5 char:1
    + Get-PowerBICapacity -Scope Individual
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-PowerBICapacity], Exception
    + FullyQualifiedErrorId : System.Exception,Microsoft.PowerBI.Commands.Capacities.GetPowerBICapacity

    • Watsky's avatar
      Watsky
      Solution Sage

      Hey kerski,

      You have to login first before you can run the command. So your Power Shell should look like this:

      Login-PowerBIServiceAccount 
      Get-PowerBICapacity -Scope Individual

       This is as long as you are using the regular public enivronment for Power BI (Non-government cloud).