Get-PowerBIActivityEvents returns a list of objects with empty list attributes
I have the following code:
$start = (Get-Date).AddHours(-10).ToString("yyyy-MM-ddTHH:mm:ss")
$end = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ss")
# Don't pipe through Out-String or ConvertFrom-Json
$activities = Get-PowerBIActivityEvent `
-StartDateTime $start `
-EndDateTime $end `
-ActivityType 'ViewReport' `
-ErrorAction Stop | ConvertFrom-Json
$activities[0]That outputs the following:
Id : {}
RecordType : {}
CreationTime : {}
Operation : {}
OrganizationId : {}
UserType : {}
UserKey : {}
Workload : {}
UserId : {}
ClientIP : {}
UserAgent : {}
Activity : {}
ItemName : {}
WorkSpaceName : {}
DatasetName : {}
ReportName : {}
CapacityId : {}
CapacityName : {}
WorkspaceId : {}
ObjectId : {}
DatasetId : {}
ReportId : {}
ArtifactId : {}
ArtifactName : {}
IsSuccess : {}
ReportType : {}
RequestId : {}
ActivityId : {}
DistributionMethod : {}
ConsumptionMethod : {}
ArtifactKind : {}
RefreshEnforcementPolicy : {}
BillingType : {}I am trying to figure out why I am getting objects for which each attribute is just an empty list. I have followed the official documentation for this Cmdlet but I can't figure out why this is happening.
I've also tried not using ConvertFrom-Json and just log the Json string. However, I get the same result.
Documentation I'm following: Access the Power BI activity log - Power BI | Microsoft Learn
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.
-