Paul T
Paul T

Reputation: 11

Get-PowerBIWorkspace in powershell returns blank elements

I am attempting to pull the various Workspaces and associated user details from Power BI using the Powershell Power BI Management objects. When I make a call to the Get-PowerBIWorkspace in powershell, the user element (and others) is blank

Connect-PowerBIServiceAccount -Credential $credential

$Groups = Get-PowerBIWorkspace

foreach($group in $Groups)
{
    $group
}

Disconnect-PowerBIServiceAccount

Exampl output

Id                    : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Name                  : test
IsReadOnly            : False
IsOnDedicatedCapacity : False
CapacityId            : 
Description           : 
Type                  : 
State                 : 
IsOrphaned            : False
Users                 : 
Reports               : 
Dashboards            : 
Datasets              : 
Dataflows             : 
Workbooks             : 

Has anyone seen this before?

Upvotes: 0

Views: 1328

Answers (1)

Paul T
Paul T

Reputation: 11

A bit more tinkering and I got the below bit of code to list out the users. Obviously it will need some tidying up.

$workspaces = Get-PowerBIWorkspace -Scope Organization -All | Where {($_.Type -eq "Workspace") -and ($_.State -eq "Active")}

foreach ($workspace in $workspaces)
{
    $user = $workspace.Users
    $user.Identifier
}

Upvotes: 1

Related Questions