SOLVED

Junk folder

Brass Contributor

Hi experts

someuser@somedomain.com has sent an email with subject:xyz to 500 users on 20 May 2018. I want to move this email to JUNK FOLDER for all these users. i have usernames in csv file

How do i achive this.

1 Reply
best response confirmed by Rising Flight (Brass Contributor)
Solution
Name myuser1@mydomain.com myuser2@mydomain.com $mailboxes = Import-Csv c:\users.csv foreach($mailbox in $mailboxes){ Search-Mailbox -Identity $mailbox.Name -SearchQuery 'From:"somespammer@somedomain.com" AND Subject:"spam" AND Received:"05/22/2018"' -DeleteContent -force }
1 best response

Accepted Solutions
best response confirmed by Rising Flight (Brass Contributor)
Solution
Name myuser1@mydomain.com myuser2@mydomain.com $mailboxes = Import-Csv c:\users.csv foreach($mailbox in $mailboxes){ Search-Mailbox -Identity $mailbox.Name -SearchQuery 'From:"somespammer@somedomain.com" AND Subject:"spam" AND Received:"05/22/2018"' -DeleteContent -force }

View solution in original post