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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
urraghu
Frequent Visitor

retrieve specific workspaces data using Get-PowerBIActivityEvent

We are able to retrieve activity logs using "Get-PowerBIActivityEvent" but it is returning the activity logs for all workspaces in the tenant. I see only side parameters like -UserId and -ActivityType are available for ‘Get-PowerBIActivityEvent’ for filtering data. My requirement is to retrieve/filter data based on parameters like Workspaces names or Workspace Owner names. please help to advise on the possibilities. 

4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @urraghu ,

 

I'm afraid that there are no such filters on activity logs. I suggeste create an idea for it in https://ideas.powerbi.com/forums/265200-power-bi-ideas to improve the power bi.

 

Best Regards,

Dedmon Dai

It can be done using something like this
$allAudits = Get-PowerBIActivityEvent -StartDateTime $pivotDate.ToString("s") -EndDateTime $pivotDate.AddHours(24).AddSeconds(-1).ToString("s") -ActivityType "ViewReport" | ConvertFrom-Json


$audits = $allAudits | Where-Object { $_.WorkspaceName -eq "your_workspace_name" }

urraghu
Frequent Visitor

We have a requirement to pull these logs on a weekly basis (and filter data based on Workspace name/owner). Any inputs on automating such requirement?

arvindsingh802
Super User
Super User

Currenlty that does not allow you to filter data based on Worksapce owner as this is user activities logs.

 

I would suggest to pull the data and filter it based on your requirement in next step. (i.e. workspaceid)

 

If this post helps, then please consider Accept it as the solution and give it a thumbs up


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors