1

Client Mailbox Exchange 2013 Microsoft Scripting
Looking for a script that will accomplish the following task. Copy all email from a user’s mailbox that meets a specific date. The copy script should only execute based on the effective date plus 60 days. For example, if a daily script started running Oct 1st, no emails will be copied until Nov 30th. So on Nov 30th only emails from Oct 1st will be copied. On Dec 1st emails from Oct 2nd will be copied, so on an so forth. We would like to copy email from all mail folders except deleted items.

We are running exchange 2013. Is there are script or software that anyone can think of that can accomplish this task?

Please let me know if there are any additional questions.

aaron
  • 11
  • 1

2 Answers2

1

Yup, Search-Mailbox

Run this anytime in the first week (like the first sunday at 2am) for all emails received last month.

Date Functions:

$ReportStartDate = (get-date).AddMonths(-2).ToString("MM/01/yyyy")
$ReportEndDate = (get-date).ToString("MM/01/yyyy")

Start and end dates are at midnight (00:00) so it will not have any data from the 1st, as it ends before any time begins on the 1st.

Search Script:

Search-Mailbox -id "User" -targetmailbox "Administrator" -SearchQuery "Received:$ReportStartDate...$ReportEndDate" -targetFolder "Search: $ReportStartDate - $ReportEndDate"

Additionally: You need permissions to search user mailboxes

The “Search-Mailbox” cmdlet is only available to users with the Exchange role “Mailbox Search”. By default this role is granted to all users of the Active Directory group “Discovery Management”

Add-ADGroupMember "Discovery Management" "USERNAME"

(tested on 2013 CU10, should work on 2010-2016)

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
0

It's an Enterprise CAL licensed feature, but In-Place eDiscovery does exactly that. http://www.msexchange.org/articles-tutorials/exchange-server-2013/compliance-policies-archiving/exchange-2013-place-hold-and-place-ediscovery-part1.html