Solved

wildcards in powershell?

Posted on 2013-06-12
4
319 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 Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an Address List 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 Organization >> Ad…
In this video we show how to create an email address policy 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 Mail Flow…

708 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

18 Experts available now in Live!

Get 1:1 Help Now