Solved

Exchange 2007 Export-Mailbox Help

Posted on 2013-06-18
4
287 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 18

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 18

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates‚Ķ

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now