Exch2k7 spk3 - cmdlet get-mailboxStatistics and send the results by e-mail
Hi,
in our old server (exch2k3) we were using WMI/VBS to catch some information about the SMTP QUEUE and mailbox also. In the new server I´m using (manually) the command bellow.
The question is:
- Is still available the usage of WMI/VBS in exch2k7?
- Is there a way to automate that statistics other than using PowerShell/script?
- Is possible to send the results from cmdlet by e-mail?
get-mailboxstatistics -identity SPAM | ft ItemCount
tks, Renato P
October 19th, 2011 8:17am
I found some scripts (example below), the e-mail is sent but the content/body is shown as:
Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData
Microsoft.PowerShell.Commands.Internal.Format.FormatEndData
########
Script sample
########
$emailFrom = “noc@xyz.com.br”
$emailTo = “renato.pereira@xyz.com.br”
$subject = “Mailbox SPAM”
$body = get-mailboxstatistics -identity SPAM -server MAILSERVER | ft ItemCount
$smtpServer = “farol.xyz.com.br”
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$credentials=new-object system.net.networkcredential(”spam”,”password”)
$smtp.credentials=$credentials.getcredential($smtpserver,25,"basic”)
$smtp.Send($emailFrom, $emailTo, $subject, $body)
tks, Renato P
Free Windows Admin Tool Kit Click here and download it now
October 19th, 2011 9:07am
Try change the $body as below
$body = (get-mailboxstatistics -identity SPAM).ItemCount
October 20th, 2011 2:53am
Tks shuen100,
worked fine!
* You are my hero!tks, Renato P
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2011 8:02am