Forum Discussion
Get-PowerBIActivityEvent - Unexpected error. I have Power BI Admin
- 5 years ago
Hi chiamaka ,
This datetime format is not supported, please try the code below.
Get-PowerBIActivityEvent (MicrosoftPowerBIMgmt.Admin) | Microsoft Docs
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Got it working now - I used below:
#Install-Module -Name MicrosoftPowerBIMgmt -Force
$StartDateToExtract = '2021-04-08T00:00:00'
$EndDateToExtract = '2021-04-08T23:59:59'
$activities = Get-PowerBIActivityEvent -StartDateTime $StartDateToExtract -EndDateTime $EndDateToExtract |ConvertFrom-JSON
#$activities.count
$activities | Select Id, RecordType, CreationTime, Operation, OrganisationId, UserType, Workload, UserId, ClientIP, userAgent, Activity,
ItemName, WorkspaceName, DatasetName, ReportName,
CapacityId, CapacityName, WorkspaceId, AppName, ObjectId, DatasetId, ReportId, IsSuccess,
ReportType, RequestId, ActivityId, AppReportId, DistributionMethod, ConsumptionMethod | Export-Csv -Path $activityLogOutput -NoTypeInformation