Nob Y
asked on
Exchange 2013 - Empty all mailboxes within a database
Hi, I've got 150mailboxes within this database. All the mailboxes are used during a specific period of time per year. By the end of the season, is there a script I can run to empty all the mails in the mailboxes? so when users start again next season there will be no mails left in them.
thanks,
thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Mas and CodeTwo,
Appreciated the help, let me try the scripts.
Cheers,
Nob
Appreciated the help, let me try the scripts.
Cheers,
Nob
1)
Search-Mailbox -Identity “April Stewart” -DeleteContent
2)
Export-Mailbox -identity “April Stewart” -DeleteContent
Your account must be a member of the group: “Mailbox Import Export”.
Reference : http://technet.microsoft.com/en-us/library/dd298173.aspx
Search-Mailbox -Identity “April Stewart” -DeleteContent
2)
Export-Mailbox -identity “April Stewart” -DeleteContent
Your account must be a member of the group: “Mailbox Import Export”.
Reference : http://technet.microsoft.com/en-us/library/dd298173.aspx
ASKER
Thanks for the help, the script worked great.
Open in new window
You will be then prompted to confirm the deletion (to skip this confirmation, run the Search-Malbox command with a -Force switch).
For more on deleting content from mailboxes using Search-Mailbox -DeleteContent see: https://www.codetwo.com/admins-blog/how-to-delete-email-from-mailboxes-on-exchange-2016-2013-2010-online/?sts=6651
Hope this helps,
CodeTwo