Get-Content for selected mailboxes for this command = Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent
Dear Experts, I need to use the Get-Content command for collecting some group of people mailboxes in a TXT or CSV and then delete the content with below command. Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent To make it clear instead of getting whole -Database DB1 i need to delte the content from only specific mailboxes which are spread across different DBs. I know we can use.... -OrganizationalUnit or -DistributionList but users are spread across multiple DBs Regards, Manju
April 25th, 2012 3:10am

$Userlist = get-content c:\userlist.txt foreach ($user in $userlist) {Export-Mailbox $user -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent} Mike Crowley | MVP My Blog -- Planet Technologies
Free Windows Admin Tool Kit Click here and download it now
April 25th, 2012 9:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics