Delete Mails in Exchange Mailbox in specific folder

Welcome Forums General PowerShell Q&A Delete Mails in Exchange Mailbox in specific folder

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
3 years, 9 months ago.

  • Author
    Posts
  • #26908

    Participant
    Points: 0
    Rank: Member

    Hi there,

    I'm looking at a clients exchange where they have a mailbox with large amounts of emails,

    I need to delete all the mails in a specific folder.I tried the following one liner and multiple like it and did not get it working

    Search-Mailbox -Identity "name" -TargetMailbox "Mailboxname" -TargetFolder "foldername" -LogLevel Full -DeleteContent

    Can you please help asap.

  • #26909

    Participant
    Points: 0
    Rank: Member

    When I run it form the exchange shell I get the following message

    WARNING: The source mailbox 'mailbox' will not be searched because it is the target mailbox. The source mailbox
    cannot be used as the target mailbox.

  • #26962

    Participant
    Points: 0
    Rank: Member

    You cannot search a specific folder I believe, you can fine tune to when sent it or received

    search-mailbox -identiy "Mailbox ID" -searchquery {Sent:"06/30/2015"} -deletecontent

    Note the date format though

The topic ‘Delete Mails in Exchange Mailbox in specific folder’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort