Solved

wildcards in powershell?

Posted on 2013-06-12
4
323 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 41

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

948 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

21 Experts available now in Live!

Get 1:1 Help Now