Hi,
Welcome to Microsoft Q&A community!
Here’s a revised version of your PowerShell script:
$date = (Get-Date).AddDays(-30)
$Today = Get-Date
Search-UnifiedAuditLog -StartDate $date -EndDate $Today -RecordType ExchangeAdmin -Operations Add-DistributionGroupMember,Remove-DistributionGroupMember,Update-DistributionGroupMember -ObjectIds dl1@contoso.com -ResultSize 5000 | Export-CSV C:\temp\output.csv -NoTypeInformation -Encoding UTF8
Key Changes:
Date Variables: Use Get-Date directly without converting to a string.
RecordType: Specify ExchangeAdmin to focus on administrative changes.
Operations: Ensure the cmdlets are correctly specified.
ResultSize: Increase the result size to ensure you capture all relevant logs.
Any updates please be free to contact us!