Quantcast
Channel: Exchange Server 2013 - Mail Flow and Secure Messaging forum
Viewing all articles
Browse latest Browse all 3660

Powershell Advise required for MessageTracking

$
0
0

Hello,

Im wondering if anyone can help me.  Im getting to grips with the basics of Powershell now but Im attempting to setup a little script that will assist me and the rest of our exchange administrators to pull back quick results from MessageTrackingLog instead of using the EMC Tracking tool of editing a command every time we want to do tracking.  The problem I have is that I wish to use most of the parameters available to the powershell cmdlet 'get-messagetrackinglog' via read-host -prompts.  But if you dont enter data in every one the script doesnt actually work. You just get an 'OK' response. You will see the couple of lines below that im trying to excempt from the requirement of data in the script.

I will paste exactly where I am upto below to try and resolve the issue.  Any assistance is greatly appreciated.....

[System.Windows.Forms.MessageBox]::Show("WELCOME TO MESSAGE TRACKING" , "EMAIL TRACKING")
$server = Read-Host –Prompt ‘Enter Server Name to view Tracking Upon’
$EventID = Read-Host –Prompt ‘Enter The EVENT ID'
$Sender = Read-Host –Prompt ‘Enter The SMTP Address of the Sender Account’
if ($sender -eq 'SEND')
{ Out-Host ""}
else
{}
$Recipients = Read-Host –Prompt ‘Enter The SMTP Address of the Recipient Account’
$MessageSubject = Read-Host –Prompt ‘Enter THE SUBJECT of the email you want to filter’
if ($messagesubject -eq $null)
{ Out-Host ""}

else
{}    

$StartDate = Read-Host –Prompt ‘Enter The Start Date for Message Tracking - FORMAT dd/mm/yyyy hh:mm:ss’
$EndDate = Read-Host –Prompt ‘Enter The End Date for Message Tracking - FORMAT dd/mm/yyyy hh:mm:ss’

Get-MessageTrackingLog -Server $server -EventID $EventID -Sender $sender -Recipients $recipients -MessageSubject $MessageSubject -Start $StartDate -End $EndDate | Select Timestamp, EventID, Sender, {$_.Recipients}, MessageSubject


Viewing all articles
Browse latest Browse all 3660

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>