locked
Get-Content for selected mailboxes for this command = Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent RRS feed

  • Question

  • 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

    Wednesday, April 25, 2012 7:01 AM

Answers

  • $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

    Wednesday, April 25, 2012 1:54 PM