I want to:
- generate mailbox usage statistics
- convert it to pdf (if possible)
- send this file as attachment
- use windows scheduler to send mail
Can someone show me how to accomplish this?
I am using:
- Exchange 2013
- Windows Server 2012
Thanks
Technology Tips and News
I want to:
Can someone show me how to accomplish this?
I am using:
Thanks
Hi,
Paul has written an article to start with using Log Parser. Not a complete solution as you are looking for, but will help: http://exchangeserverpro.com/exchange-2010-message-tracking-event-ids-log-parser/
Hi M.K,
Base on my knowledge, you can accomplish your requirements except convert to pdf.
Try to save the following command as .PS1 file and use windows scheduler to run it:
$day = Get-Date -UFormat "%Y%m%d" $filename="c:\MBX-$day.csv" $mailboxes=Get-MailboxStatistics UserName | fl >>$filename $from="Anything@yourdomain.com" $to="UserName@yourdomain.com" $title="MBX Usage Statistics Report" $body="Anything you want to write." $smtp = new-Object System.Net.Mail.SmtpClient("Smtp.yourdomain.com") $emailMsg = new-Object System.Net.Mail.MailMessage($from,$to,$title,$body) $attachment = new-Object System.Net.Mail.Attachment($filename) $emailMsg.Attachments.Add($attachment) $smtp.Send($emailMsg)
Best regards,