Solved

wildcards in powershell?

Posted on 2013-06-12
4
326 Views
Last Modified: 2013-06-17
i am trying to pull some records from the journal from @domain.com and to @domain.com  i know the syntax to pull from the journal and to place in a target mailbox, but for the life of me i can't figure out how to pull these messages.  i need to pull all this communication for our attorney ASAP and am desperate. Please help!

thanks.
0
Comment
Question by:Roy Ortiz
  • 2
4 Comments
 
LVL 13

Assisted Solution

by:Ugo Mena
Ugo Mena earned 20 total points
ID: 39241822
I am going to assume you mean the message tracking log not journal.

The following commandlet lists all emails to a domain from outside your organization during a given time fame. It then sorts into a columns and exports to a .txt or .csv.

get-messagetrackinglog -server "mailserver" -Start "01/01/2012 09:00:00" -End "01/01/2013 17:00:00" -resultsize unlimited | where {$_.Recipients -like "*@domainname"} | Select timestamp,recipients,messagesubject,source >>c:\exported.txt

Replace mailserver with your exchange server’s name. -server "mailserver"

Change the timeframe -Start "01/01/2012 09:00:00" -End "01/01/2013 17:00:00"

Change the domain name is it searching from where {$_.Recipients -like "*@domainname"}
To search for emails sending from a particular domain change where {$_.Recipients -like "*@domainname"} to where {$_.Sender -like "*@domainname"}

Change the c:\exported.txt to whatever you want your output file to be named and saved.


http://technet.microsoft.com/en-us/library/bb124926%28v=exchg.141%29.aspx

Above link describes how to use the Exchange Management Console or the Exchange Management Shell to search the message tracking logs
0
 
LVL 42

Assisted Solution

by:Amit
Amit earned 20 total points
ID: 39242118
Are you referring to Journal mailbox?
0
 

Accepted Solution

by:
Roy Ortiz earned 0 total points
ID: 39242413
yes i was referring to the journal.  i was able to figure it out by simply leaving out any kind of wildcard and just using To:@domain.com, then running it again using From:@domain.com.  This has give us just what we needed. thanks for the advice though.
0
 

Author Closing Comment

by:Roy Ortiz
ID: 39252597
after some test runs in powershell i was able to discover how to run the queries i needed.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Both MMF (multi-mode fiber) and SMF (single-mode fiber) are types of optical fiber that can aid in communication applications. These thin strands of silica or glass will allow communication to occur between devices. The transmission of light between…
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video discusses moving either the default database or any database to a new volume.

821 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