Solved

Exchange 2007 Export-Mailbox Help

Posted on 2013-06-18
4
321 Views
Last Modified: 2013-06-24
I need to run a export-mailbox weekly to move the mail from the inbox to an archive folder under the same email account. I would like to create a sub folder for each weekly archive to be the date of the archive run

Export-Mailbox -Identity journal -includefolder '\inbox'  -TargetMailbox journal -TargetFolder archive\date


I know I can add the -startdate $((get-date).adddays(-7))  -enddate $(get-date) to pull the data by the date

I would like to name the folders of archive by the name of the date.

example

Archive
       061013
       061713

Thanks
0
Comment
Question by:Thomas Grassi
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
suriyaehnop earned 500 total points
ID: 39258449
try this

$today = Get-Date -Format "MMddyyyy"

$Folder = New-Item C:\Users\Archive -type Directory

$Mainfolder = 

$subfolder = New-Item $Folder '\' $today -type Directory

Export-Mailbox -Identity journal -includefolder '\inbox'  -TargetMailbox journal -TargetFolder $subfolder

Open in new window

0
 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39261022
Thanks I  for the info

I just tested and it failed after I ran it a second time

could not create the directory because c:\users\archive already exsits

I was hoping to run this like outlook does for archiving  move all archive messages into an archive folder

Like

inboxc
    archive
         201301
         201302

etc

This is copying everything to the local hard drive I would like to keep it so I can look at the email based on month and year

Any ideas
0
 
LVL 23

Author Closing Comment

by:Thomas Grassi
ID: 39273304
lead me to possible solution but the script did not work as listed
0
 
LVL 19

Expert Comment

by:suriyaehnop
ID: 39273387
Could you share your script
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question