Last active
October 1, 2020 18:15
-
-
Save anelliaf/7a43c7f5105d235ff9cdd969498ced7d to your computer and use it in GitHub Desktop.
PowerShell script to list Power BI workspaces and export to Excel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Connect-PowerBIServiceAccount | |
| #Get-PowerBIWorkspace | Get-Member | |
| #$ws = Get-PowerBIWorkspace -Scope Organization -Filter "tolower(name) eq 'testworkspace'" | |
| #$ws = Get-PowerBIWorkspace -Scope Organization | Where {($_.IsOnDedicatedCapacity -eq $true) -and ($_.State -eq "Active") -and ($_.Type -ne "PersonalGroup")} | |
| $ws = Get-PowerBIWorkspace -Scope Organization -All | |
| $workspace = | |
| foreach ($w in $ws) { | |
| [PSCustomObject] @{ | |
| Name = $w.Name | |
| Type = $w.Type | |
| State = $w.State | |
| "Dedicated Capacity" = $w.IsOnDedicatedCapacity | |
| } | |
| } | |
| $workspace | Export-Excel -Path C:\Temp\pbi_workspaces.xls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment