Forum Discussion
Get-PowerBIActivityEvents returns a list of objects with empty list attributes
- 1 year ago
Hi Anonymous ,
Thank you for reaching out to Microsoft Fabric Community Forum.
The error you're getting from Get-PowerBIActivityEvents means your current Power BI account doesn't have the required admin privileges to access activity log data.
You must have :
-
Power BI Service Administrator OR
-
Office 365 Global Administrator
If you're not one of these, you'll need to request access from your IT/Admin team.
Regards,
Chaithanya.
-
Does it work without the activitytype filter?
Even without the activity filter, I get the same result.
- Deku1 year agoSuper User
Think either the dates are misformed or no data in the period.
Try outputting the datetimes strings to sense check. Also try looking back a full 30 days, without a activitytype file
- Deku1 year agoSuper User
This is a wrapper on the Get Activity Events API. Make sure you are fabric admin or using a service principal with delegated permissions.
- Anonymous1 year agoNot applicable
If I didn't have fabric admin role, I think I would have gotten 403 unauthorized but now I'm just getting bad request. Can you confirm if this is true?
- Anonymous1 year agoNot applicable
Updated the code as such:
$start = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.fff") $end = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ss.fff") Write-Host $start to $end $activities = Get-PowerBIActivityEvent ` -StartDateTime $start ` -EndDateTime $end | ConvertFrom-Json ` -ErrorAction Stop $activitiesI get the following output and error:
2025-03-16T08:15:00.598 to 2025-04-15T08:15:00.599 Get-PowerBIActivityEvent : Operation returned an invalid status code 'BadRequest' At C:\Users\jafarip\OneDrive - TC TC\Desktop\DV-RD\Scripts\Get-MigrationActivityEvents.ps1:7 char:19 + $activities = Get-PowerBIActivityEvent ` + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (Microsoft.Power...BIActivityEvent:GetPowerBIActivityEvent) [Get-PowerBIActivityEvent], HttpOperationExcep tion + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEventIt's becasue the Cmdlet doesn't work with long time ranges (30 days). I tested that it works with max half a day worth of range.
- v-kathullac1 year agoCommunity Support
Hi Anonymous ,
Thank you for reaching out to Microsoft Fabric Community Forum.
The error you're getting from Get-PowerBIActivityEvents means your current Power BI account doesn't have the required admin privileges to access activity log data.
You must have :
-
Power BI Service Administrator OR
-
Office 365 Global Administrator
If you're not one of these, you'll need to request access from your IT/Admin team.
Regards,
Chaithanya.
-