Share via

Powerbi Usage powershell scripts failed

Anonymous
2023-05-22T10:41:40.5066667+00:00

Dear All,

 

I was running this below mentioned powershell scripts for the last 8 months but last 5 days i am getting error and the scripts are not running and getting the error.If I run sepeartely while connecting exchange online its running

 

Please help.

 

$connectsplat = @{

Certificatefilepath = 'C:\Windows\system32\Exocert.pfx'
Certificatepassword = $(ConvertTo-SecureString -String "abc" -AsPlainText -Force)
Appid = '123'
Organization = "abc.ONMICROSOFT.COM"
}

Connect-ExchangeOnline @connectsplat

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-180) -EndDate (Get-Date) -RecordType PowerBIaudit -ResultSize 5000 | ConvertTo-Csv | Out-File C:\FinalDeployment\Powerbiusage\PowerBIAuditLog.csv

 

 

error : "Write-ErrorMessage : One or more errors occurred.
At C:\Users\s.muthu\AppData\Local\Temp\7\tmpEXO_2krypd2t.zsm\tmpEXO_2krypd2t.zsm.psm1:1120 char:13

  • Write-ErrorMessage $ErrorObject
  • CategoryInfo : NotSpecified: (:) [Search-UnifiedAuditLog], Exception
  • FullyQualifiedErrorId : [Server=DX1P273MB0490,RequestId=b2812735-eb75-c183-aba7-29b9b590442e,TimeStamp=Mon, 22 May 2023 09:17:19 GMT],Write-ErrorMessage"
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

1 answer

Sort by: Most helpful
  1. Limitless Technology 45,241 Reputation points
    2023-05-23T11:20:48.41+00:00

    Hello there,

    As you are using this script for long time try checking for any latest change in the device like an windows update which might have changed the rights within the device.

    The error usually occurs if you are not passing right parameters with New-PowerBIReport command.

    Instead of using the .Process() method on the database object, you need to use the .RequestRefresh() (with the appropriately refresh type) against the model object, then the .SaveChanges() method to send the command.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    Was this answer helpful?

    0 comments No comments

Your answer

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