Hi
I am using the following script to delete content from a mailbox:
Get-Mailbox -Identity User1 | Export-Mailbox -SubjectKeywords “Deletethis” -StartDate “12/12/2011" -DeleteContent
| out-file c:\results.log
I actually have several mailboxes that I need to do this on, so am going to use this:
Get-content c:\userlist.txt | ForEach-Object {Export-Mailbox -Identity $_ -SubjectKeywords “Deletethis” -StartDate “12/12/2011" -DeleteContent}
What I'd like to be able to have is a result file at the end of the script that lists the mailboxes that the script worked on and how many messages were deleted.
Does anyone know how this is possible?
Our community of experts have been thoroughly vetted for their expertise and industry experience.