ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC

    IT Discussion
    exchange 2013
    3
    12
    790
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dbeato @wirestyle22
      last edited by

      @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

      Found this:

      Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -TargetMailbox administrator -TargetFolder "SearchAndDeleteLog" -LogOnly -LogLevel Full

      but I want it to apply to all mailboxes. Simultaneously searching, but figured I should ask here as well.

      For all users

      Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Your bank statement"' –DeleteContent
      

      For Search Results

      Get-mailbox | search-mailbox –searchquery “Subject:’Your bank statement’” –Logonly –Targetmailbox administrator –Targetfolder Inbox
      1 Reply Last reply Reply Quote 2
      • T
        travisdh1
        last edited by

        Someone sent a bank statement to the everyone group?

        We found HR documents with people's Social Security numbers in a document everyone has read access to at a place yesterday. Wasn't caught because whoever put the document together used a screenshot, but didn't take an extra 10 seconds to black out that one section. Great times.

        W 1 Reply Last reply Reply Quote 0
        • W
          wirestyle22 @travisdh1
          last edited by

          @travisdh1 No it's an example

          1 Reply Last reply Reply Quote 0
          • W
            wirestyle22
            last edited by wirestyle22

            hmm

            0_1540475298362_stuff.PNG

            D 1 Reply Last reply Reply Quote 0
            • D
              dbeato @wirestyle22
              last edited by

              @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

              hmm

              0_1540475298362_stuff.PNG

              Do you have the MailboxImportExport Role assigned to your user?

              W 1 Reply Last reply Reply Quote 0
              • W
                wirestyle22 @dbeato
                last edited by

                @dbeato said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

                @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

                hmm

                0_1540475298362_stuff.PNG

                Do you have the MailboxImportExport Role assigned to your user?

                Unsure what we have setup here. Haven't played with exchange yet

                D 1 Reply Last reply Reply Quote 0
                • D
                  dbeato @wirestyle22
                  last edited by dbeato

                  @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

                  @dbeato said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

                  @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:

                  hmm

                  0_1540475298362_stuff.PNG

                  Do you have the MailboxImportExport Role assigned to your user?

                  Unsure what we have setup here. Haven't played with exchange yet

                  Add your user to the group

                  New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "username"
                  

                  Then Close the Exchange EMC and then open it again and run the search.

                  1 Reply Last reply Reply Quote 1
                  • W
                    wirestyle22
                    last edited by wirestyle22

                    What about wildcards @dbeato?

                    Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Random characters* other stuff"' –DeleteContent"' –DeleteContent
                    
                    D 1 Reply Last reply Reply Quote 0
                    • D
                      dbeato @wirestyle22
                      last edited by

                      @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:

                      What about wildcards @dbeato?

                      Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Random characters* other stuff"' –DeleteContent"' –DeleteContent
                      

                      It should work.

                      W 1 Reply Last reply Reply Quote 0
                      • W
                        wirestyle22 @dbeato
                        last edited by wirestyle22

                        @dbeato said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:

                        'Subject:"Random characters* other stuff"'

                        so this?

                        'Subject:"*other stuff"'
                        
                        D 1 Reply Last reply Reply Quote 0
                        • D
                          dbeato @wirestyle22
                          last edited by

                          @wirestyle22 said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:

                          @dbeato said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:

                          'Subject:"Random characters* other stuff"'

                          so this?

                          'Subject:"*other stuff"'
                          

                          Correct. DO a search first and see the results and then proceed to deletion.

                          1 Reply Last reply Reply Quote 2
                          • 1 / 1
                          • First post
                            Last post