Forum Discussion
Lorenz33
Helper IV
3 years agoTrack Power BI user activities with Activity Log
We have a necessity to track user access to specific reports on our Power BI instance. According to the this article, we can use the activity log to retrieve tracking/audit information for a Power BI...
Thomaslleblanc
Super User
1 year agoHere is the code I use in Powershell that works:
ForEach-Object {
$Date = (((Get-Date).Date).AddDays(-$_))
$StartDate = (Get-Date -Date ($Date) -Format yyyy-MM-ddTHH:mm:ss)
$EndDate = (Get-Date -Date ((($Date).AddDays(1)).AddMilliseconds(-1)) -Format yyyy-MM-ddTHH:mm:ss)
Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndDate -ResultType JsonString |
Out-File -FilePath "$($jobOutputPath)\AuditLog_$(Get-Date -Date $Date -Format yyyyMMdd).json"
Write-Output "Get data." + $Date
}