Link to home
Start Free TrialLog in
Avatar of ProjNet
ProjNetFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Coping All Emails from Specific domain address to Specific folder

Hello,

I need to copy emails from a specific email domain to a specific mailbox and folder that I have created,

the cmdlets that I've just used is:

Get-mailbox -resultsize unlimited| Export-Mailbox -SenderKeywords "stacatruc.co.uk" -TargetMailbox adurrant -TargetFolder 'StacATruc'

all this did was a create a number of folders in my mailbox, so I had to cancel the command!

like above, it's really important that the emails get copied and not moved.

It's on Exchange 2007 and multiple databases.

Thanks in advance
Avatar of Chris
Chris
Flag of United Kingdom of Great Britain and Northern Ireland image

Your syntax looks good. It's been quite a while since I last did this (Especially since in 2010 you can perform the same through Discovery Mailboxes). I cant remember the format for the SenderKeywords field and whether or not a wildcard is required. I also can't find a definitive conclusion online. You could try "*stacatrue.co.uk" and "@stacatrue.co.uk" and see what happens.
Avatar of ProjNet

ASKER

Yup this is what I tried:

Get-mailbox -resultsize unlimited| Export-Mailbox -SenderKeywords "stacatruc.co.uk" -TargetMailbox adurrant -TargetFolder 'StacATruc'

Am getting this though, which is quite a lot:

 User generated image
You sure it’s coping and not moving?

I’ve cancelled it, looked in my outlook:

 User generated image
Can’t see any emails in the folders though :/

WEIRD
It will only move the mail if you've used the -DeleteContent switch:

The DeleteContent parameter specifies the option to delete the content from the source mailbox after it has been exported to a folder. The source folder will not be deleted.

http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx

The command you've used should only copy.

One thing to note with the export-mailbox commandlet (if I recall correctly) is that if you search by keywords, the entire mailbox first gets copied to the destination, then the search is performed in the destination mailbox.

This will obviously mean you get thousands of messages copied across until it's been back through and thinned them out.
ASKER CERTIFIED SOLUTION
Avatar of ProjNet
ProjNet
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ProjNet

ASKER

No answers really worked for me.