Generate mailbox usage statistics and send it by email.

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


May 25th, 2015 3:40pm

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/

Free Windows Admin Tool Kit Click here and download it now
May 25th, 2015 11:21pm

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,

May 26th, 2015 2:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics