troubleshooting Question

Results file for Exch Powershell script

Avatar of Joe_Budden
Joe_Budden asked on
ExchangePowershell
4 Comments2 Solutions197 ViewsLast Modified:
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?
ASKER CERTIFIED SOLUTION
suriyaehnop

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros