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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.