Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Saravanan_ameer
Frequent Visitor

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. 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"

 

Saravanan_ameer_0-1684747077675.png

 

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

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:

search-unifiedauditlog: Write-ErrorMessage : One or more errors occurred. · Issue #10870 · Microsoft...

Search-UnifiedAuditLog Error : Write-ErrorMessage : One or more errors occurred. · Issue #10693 · Mi...

Search-UnifiedAuditLog Error : Write-ErrorMessage : One or more errors occurred when connected to de...

 

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.