Avatar of danbrown_
danbrown_
Flag for United States of America asked on

Exchange contact export failing

Hello Experts - I made a post yesterday asking about the syntax for exporting Outlook contacts from an Exchange 2010 server limited by a date range.  I thought I had it since the command ran without errors but the output has no data so I closed it too soon.  Here is the command I'm running:

New-MailboxExportRequest -ContentFilter {(Received -lt '01/01/2019') -and (Received -gt '02/06/2019')} -Mailbox user1@domain.com -IncludeFolders "#Contacts#" -excludedumpster -filepath \\server\c$\contacts\user.pst

This returns a 256KB PST file which is empty regardless of the date range or user I am running it against.  Do I have this setup right?  Maybe something that only works in later versions of Exchange?
PowershellExchangeOutlookWindows OS

Avatar of undefined
Last Comment
danbrown_

8/22/2022 - Mon
FOX

1. On the folder where you want to drop the results, right click> select properties>Security and make sure you have added the group
Exchange Trusted Subsystem and give the group Read/Write permission

2. Right-click that same folder again>properties>Sharing...copy the "network path" and put it after -filepath in your command


New-MailboxExportRequest -Mailbox user1@domain.com -IncludeFolders "#Contacts#" -ContentFilter {(Received -lt '01/01/2019') -and (Received -gt '02/06/2019')} -FilePath -filepath \\server\c$\contacts\user.pst
timgreen7077

You can create the cmdlets like this:

New-MailboxExportRequest -Mailbox "username" -IncludeFolders "#contacts#" -FilePath "\\sharepath\temp\contacts.pst"

Since you are getting the contacts I'm not sure the date range will apply properly since contacts don't have a sent or received date associated to it. I just tested the cmdlets I shared and it worked properly.
danbrown_

ASKER
I have no problems exporting the entire set of contacts but needed to restrict it by date to capture them incrementally since I've already exported everything as of May 2018.  I just need contacts created after that date to avoid the duplicates.
Your help has saved me hundreds of hours of internet surfing.
fblack61
danbrown_

ASKER
I think you may be right about the date range, no matter how I format it I'm getting an empty 256KB PST file as the output.
timgreen7077

agreed, but since a sent or received date isnt associated with a contact those parameters in the cmdlets wont apply to contacts, and I dont think a created date parameter is available for the cmdlets so you may have to use a 3rd party tool to accomplish this based on date range.
danbrown_

ASKER
DO you know of a third party tool that would do this?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
timgreen7077

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
danbrown_

ASKER
Wow, that works great, thanks so much!