Forum Discussion

YashikaAgrawal's avatar
YashikaAgrawal
Post Patron
1 year ago
Solved

My workspace(reports) download using PowerShell

Guys, Iam using the below code, to download the reports, it says "Personal workspace 'My Workspace' not found."

Question_1

Can someone please let me know is this correct code or iam missing something...

 

Question_2

As a Power BI Admin, If there are 10 personal workspace, what tenant settings should be done to allow admins to view and manage the Personal workspace.

 

# Install-Module -Name MicrosoftPowerBIMgmt

# Connect to Power BI
Connect-PowerBIServiceAccount

# Get the personal workspace (replace "My Workspace" if your personal workspace has a different name)
$personalWorkspace = Get-PowerBIWorkspace -Name "My Workspace"

# Check if the personal workspace exists
if ($personalWorkspace) {
    Write-Host "Found personal workspace: $($personalWorkspace.Name)"

    # Get reports within the personal workspace
    $reports = Get-PowerBIReport -Scope Individual -WorkspaceId $personalWorkspace.Id

    # Download reports
    foreach ($report in $reports) {
        Write-Host "Downloading report: $($report.Name)"
        Export-PowerBIReport -Scope Individual -WorkspaceId $personalWorkspace.Id -Id $report.Id -Path "C:\Path\To\Download\" -Overwrite
    }

} else {
    Write-Host "Personal workspace 'My Workspace' not found."
}

 

Thanks,

 

  • Cookistador's avatar
    Cookistador
    1 year ago

    You need to set up the option 2

    This is how to get access to a personnal workspace when someone leaves your organizatrion

     

    On the other hand, you can see that the type is Personal Group and not workspace (for your powershell script)

6 Replies

  • Hi YashikaAgrawal The code needs adjustment, as "My Workspace" isn't explicitly named. Use Get-PowerBIWorkspace -Scope Individual to fetch the personal workspace. For tenant settings, enable "Personal workspaces (My Workspace)" in the Power BI Admin Portal and assign Power BI Service Administrator in Azure AD. 

    • YashikaAgrawal's avatar
      YashikaAgrawal
      Post Patron

      Which option to select here

      It this the option, can you please check..

       

      • Cookistador's avatar
        Cookistador
        Super User

        You need to set up the option 2

        This is how to get access to a personnal workspace when someone leaves your organizatrion

         

        On the other hand, you can see that the type is Personal Group and not workspace (for your powershell script)

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi YashikaAgrawal ,

    Thank you for reaching out to Microsoft Fabric Community.

    Thank you Akash_Varuna Cookistador for the prompt response.

    I want to check if you had the opportunity to review the information provided and resolve the issue.If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi YashikaAgrawal ,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.