none
script to search all emails statistics prior 7 year

    Frage

  • I am looking for a script or power shell commands which would result all the emails in the organization older than 7 years with item count & size .


    Donnerstag, 10. Mai 2018 10:29

Alle Antworten

  • https://serverfault.com/questions/485994/how-to-get-a-list-of-emails-older-than-2-years-in-exchange-database-sorted-by-u

    **Please don't forget to mark as helpful or answer**

    Donnerstag, 10. Mai 2018 12:26
  • Hi Surya,

    Do you want to do it with all mailboxes or one special mailbox?

    To achieve your requirement, we can use Search-Mailbox to search message which is received older than one day 7 years ago.

    For one special mailbox, we can run below command and list the result:
    Search-Mailbox <Mailbox>  -SearchQuery 'received<dd/mm/yyyy AND kind:email' -EstimateResultOnly


    For all mailboxes, we can run below command and list the result:
    $Accounts = Get-Mailbox -ResultSize Unlimited
    foreach($account in $Accounts) {Search-Mailbox $account -SearchQuery 'received<dd/mm/yyyy AND kind:email' -EstimateResultOnly}


    Best Regards,
    Allen Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Freitag, 11. Mai 2018 09:59
    Moderator
  • Hi,

    Any further concern about your question?
    If the above suggestion helps, please be free to mark it as answer. Thanks for your cooperation.

    Best Regards,
    Allen Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Mittwoch, 23. Mai 2018 14:54
    Moderator