Forum Discussion
Error using Get-PowerBiActivityEvent - 'BadRequest'
- Anonymous4 years ago
I had this same issue today and then noticed this in the documentation:
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-04-26 00:00:00-2022-04-26 23:59:59), then I quit receiving the error.
I had this same issue today and then noticed this in the documentation:
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-04-26 00:00:00-2022-04-26 23:59:59), then I quit receiving the error.
I am an admin and successfully connected upon running Connect-PowerBIServiceAccount
Right out of https://learn.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.admin/get-powerbiactivityevent?view=powerbi-ps, I run the folllowing:
Get-PowerBIActivityEvent -StartDateTime 2019-08-10T14:35:20 -EndDateTime 2019-08-10T18:25:50
I still get "Bad Request"
Get-PowerBIActivityEvent : Operation returned an invalid status code 'BadRequest'
At line:1 char:1
+ Get-PowerBIActivityEvent -StartDateTime 2019-08-10T14:35:20 -EndDateT ...
I can't figure out what's wrong.