The cause is that you are missing a { in this part:
foreach($mailbox in $mailboxes)
Search-Mailbox -Identity $mailbox.Name
The whole script should be:
$mailboxes = Import-Csv c:\temp\users.csv
foreach($mailbox in $mailboxes)
{
Search-Mailbox -Identity $mailbox.Name -SearchQuery {kind:meetings AND From:"user2@contos.com" AND Subject:"Test1 + Test2" AND (received>="03/03/2022 00:00" AND received<="03/04/2022 23:59")} -DeleteContent -Force
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.