These sample PowerShell script code fragments are intended to help flatten the curve when learning how to use Activity Log API in Power BI service.
These samples can help Power BI tenant admins learn how to parse data out of most popular Acitivity Log events using PowerShell. Familiarity with Power BI Admin API and Power BI PowerShell modules is desirable. PS modules need to be installed prior to executing these script blocks. See dedicated to Activity Log doc for more details. Note that the event activities have documented lag of up to 30 min. Typical for average use Power BI production tenant lag is between 15-22 min for an activity to show up in the output of this script. This is work in progress and this release is initial beta version of the script.
Requirements:
- Install Power BI PowerShell modules
- User of the PS script has to login using Connect-PowerBIServiceAccount commandlet and provide Power BI tenant Admin credentials when prompted. Tenant Admin access scope is required to access Activity Log API. Users without tenant Admin privileges will not be able to successfully execute code fragments in this script. All code fragments and scenarios are annotated with "how to" instructions and common gaps/issues to watch out for.
UPDATE [4/5/23]: replaced AAD object ID reference with UPN since AAD object ID was for beta
UPDATE [5/19/23]: added code segment for detecting active B2B users and their artifact access