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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Spurthi
New Member

Power BI Activity Log error while using PowerShell Scripts

Hi Team,

 

Trying to Download activity events by using the Power BI Management cmdlets for PowerShell for our tenant with help of this scrpits -

Login-PowerBI

$activities = Get-PowerBIActivityEvent -StartDateTime '2019-08-31T00:00:00' -EndDateTime '2019-08-31T23:59:59' | ConvertFrom-Json

$activities.Count
$activities[0]

 

But I am getting an error as stated below can you please help me where I am running as a administrator and have admin access also

Spurthi_0-1667395187203.png

Thanks,

Spurthi

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Spurthi 

As searched :

The Get-PowerBIActivityEvent cmdlet takes a StartDateTime and an EndDateTime parameter with the same restrictions as the ActivityEvents REST API. In other words, the start date and end date must reference the same date value because you can only retrieve the activity data for one day at a time.

After I set my dates to start and end on the same day (2022-11-03 00:00:00-2022-11-03 23:59:59), then I quit receiving the error.

For more information, you can refer to:

Get-PowerBIActivityEvent (MicrosoftPowerBIMgmt.Admin) | Microsoft Learn

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Spurthi 

As searched :

The Get-PowerBIActivityEvent cmdlet takes a StartDateTime and an EndDateTime parameter with the same restrictions as the ActivityEvents REST API. In other words, the start date and end date must reference the same date value because you can only retrieve the activity data for one day at a time.

After I set my dates to start and end on the same day (2022-11-03 00:00:00-2022-11-03 23:59:59), then I quit receiving the error.

For more information, you can refer to:

Get-PowerBIActivityEvent (MicrosoftPowerBIMgmt.Admin) | Microsoft Learn

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.