Forum Discussion
Ameerm2023
May 22, 2023Copper Contributor
Powerbi Usage powershell scripts failed
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"
- Did you manage to fix the issue?
- Any update?
- Did you update the ExchangeOnlineManagement module? (update-module exchangeonlinemanagement) Can you connect to Exchange Online and use the Search-UnifiedAuditLog cmdlet without any parameters? Is the certificate still valid?