One of the most powerfull feature of Exchange logs is the possibility to audit for example all emails send from the source domain: domain.com every day and send a mail to some user, this is one sample scrit that colects information and sends a mail:
$file= "c:\prova.csv" $mailboxdata= Get-MessageTrackingLog -Start "10/14/2013 00:00:00"| Where-Object {$_.sender -like "*@domain.com"} | Select-Object eventid,sender,timestamp,@{Name="Recipients";Expression={$_.recipients}},@{Name="RecipientStatus";Expression={$_.recipientstatus}},messagesubject $mailboxdata | export-csv "$file" $smtpServer = "127.0.0.1" $att = new-object Net.Mail.Attachment($file) $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = "sender@domain.com" $msg.To.Add("dest1@domain.com") $msg.To.Add("dest2@domain.com") $msg.Subject = "Emails Summary" $msg.Body = "Attached is the email server mailbox report" $msg.Attachments.Add($att) $smtp.Send($msg) $att.Dispose()