Has the powershell PBI cmdlet Get-PowerBIActivityEvent changed?

Caitlin McConnery 20 Reputation points
2023-11-01T17:32:29.9633333+00:00

I have been using the Get-PowerBIActivityEvent cmdlet to create a custom activity log for my tenant. It was working on October 2nd 2023, but now the output has seemed to changed. The data fields in the output has seemed to reduced, and almost all of the fields are null.

The following is the code block that uses the cmdlet:

# get the audit information
$NbrOfDaysToCheck =3

$FullResults = @()
#Use today to start counting back the number of days to check:
$DayUTC = (([datetime]::Today.ToUniversalTime()).Date)

#Iteratively loop through each of the last N days to view events:
For($LoopNbr=1; $LoopNbr -le $NbrOfDaysToCheck; $LoopNbr++)
{
    $PeriodStart=$DayUTC.AddDays(-$LoopNbr)
    $ActivityDate=$PeriodStart.ToString("yyyy-MM-dd")
    Write-Verbose "Checking $ActivityDate" -Verbose 
    try{
        #Check activity events once per loop (once per day):
        $FullResults += Get-PowerBIActivityEvent `
        -StartDateTime ($ActivityDate + 'T00:00:00.000') `
        -EndDateTime ($ActivityDate + 'T23:59:59.999') `
        | ConvertFrom-Json
    }
    catch {
        break
    }
}
$FullResults = $FullResults | ConvertTo-Json
$FullResults | Out-File -FilePath $activitylogpath -Append

And the output is a json file is populating (the output file size is 4652kb), but almost all the fields are empty and the column names are inconstant with the ones being returned earlier last month. I was wondering if this was due to a cmdlet change or if there is some other outstanding issue.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,579 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue 38,551 Reputation points Microsoft Vendor
    2023-11-02T08:41:54.4766667+00:00

    Hi,

    You can find the version history of the MicrosoftPowerBIMgmt module over here.

    https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt

    It was last updated on 11/15/2022.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.