Forum Discussion
How to use FOR loop in a powershell command in this audit log retrieval.
Powershell experts please pitch in your inputs.
I need a file for audit log from PowerBI for an entire month. However Powerbiactivityevent can bring data for one single day. Is there a way to loop this in a for loop for every single day of the month and generate a single file.
Cmd to run /loop
$activities = Get-PowerBIActivityEvent -StartDateTime '2021-12-15T00:00:00' -EndDateTime '2021-12-15T23:59:59' -ActivityType 'ViewReport'| ConvertFrom-Json $activities | Export-csv -Path "C:\Users\gd58\Desktop\TEMP\PowerBIAuditLog.csv" -NoTypeInformation
3 Replies
- smpa01Community Champion
BarGraph2020 Wouldn't stackoverflow be a better place to get to it quickest?
- AnonymousNot applicable
Hi BarGraph2020 ,
Here is a blog talking about How you can store All your Power BI Audit Logs easily and indefinitely in Azure - Reporting/Analytics Made easy with FourMoo and Power BI, please kindly refer to.
Best Regards,
Eyelyn Qin - AnonymousNot applicable
Hi BarGraph2020 ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.
Best Regards,
Eyelyn Qin