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. 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"
Hi @Saravanan_ameer ,
Based on web search results, this error may occur when you try to run the Search-UnifiedAuditLog cmdlet in PowerShell to search the audit log in Exchange Online. Some possible causes and solutions are:
- You may not have the required permissions to run the cmdlet. You need to be assigned the View-Only Audit Logs role or the Audit Logs role in Exchange Online. You can check your role assignments by running the Get-RoleAssignmentPolicy cmdlet.
- You may have a connectivity issue with Exchange Online. You can try to reconnect to Exchange Online by using the Connect-ExchangeOnline cmdlet with the ShowBanner parameter. This will display a banner that shows the server name and version of Exchange Online that you are connected to.
- You may have a problem with the Exchange Online Management module or the PSWSMan module. You can try to update these modules by running the Update-Module cmdlet with the names of the modules. For example:
Update-Module -Name ExchangeOnlineManagement
Update-Module -Name PSWSMan
Refer to:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
8 | |
5 | |
3 | |
2 | |
2 |