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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.