?
Solved

Exchange 2007 Export-Mailbox Help

Posted on 2013-06-18
4
Medium Priority
?
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
suriyaehnop earned 1500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

765 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