dee30
asked on
Powershell exchange get-mail with specific subject wildcard use for specific recipient.
Hello,
Looking for help in searching for email via PS based on specific criteria and/or range.
Date range from to to
recipient : address known
subject: wild card use to match "*fishing*" or "*water team*"
Get-messagetrackinglog -ResultSize Unlimited -Start "12-16-2018 7:00:00AM" -End "12-18-2018 10:30AM" -recipients:jdoe@domain.co m | where{$_MessageSubject -like "*fishing*"| select-object Timestamp,sourcecontext,so urce,event ID,Message Subject,Se nder,{$_.R ecipients} | format-table
Above doesn't work for just one subject wildcard, while I haven't even gotten to include the 'or' other criteria yet.
Some assistance on syntax would be truly be appreciated. Note on premise 2010 Exchange. Thank you.
Looking for help in searching for email via PS based on specific criteria and/or range.
Date range from to to
recipient : address known
subject: wild card use to match "*fishing*" or "*water team*"
Get-messagetrackinglog -ResultSize Unlimited -Start "12-16-2018 7:00:00AM" -End "12-18-2018 10:30AM" -recipients:jdoe@domain.co
Above doesn't work for just one subject wildcard, while I haven't even gotten to include the 'or' other criteria yet.
Some assistance on syntax would be truly be appreciated. Note on premise 2010 Exchange. Thank you.
ASKER
I got it to work... was missing the period(.) like you pointed out in front of where-objects listed, as well as a closing curly bracket/brace after *fishing*"} .
So, that all said how would update the syntax to include an 'or' , i.e., subject line to include the word *fishing* OR *net* ?
Thank you.
So, that all said how would update the syntax to include an 'or' , i.e., subject line to include the word *fishing* OR *net* ?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.. assigning points. Will try that next time.. Done with Exchange for today and moving on to some vmware issues. Thank you.
Get-messagetrackinglog -ResultSize Unlimited -Start "12-16-2018 7:00:00AM" -End "12-18-2018 10:30AM" -recipients:jdoe@domain.co