Search WWW Search

Friday, September 01, 2006

Exchange: Event Monitoring Via WMI (Backup Report)


In this article, I will provide a sample script to monitor event IDs and email the event to the specified email address. This sample code implements the use of WMI quering the Win32_NTLogEvent class for event ID 213. Event ID Source ESE 213 indicates the completion of Exchange Backups. If you do not see Event ID 213, you may be using a third party backup application that does not use the Exchange backup API. If this is the case, you will need to identify the event ID that your third party application uses.

The script will email out so you will need to specify your SMTP server in this script.

Note: You can use built in Windows command eventcreate.exe to simulate event to test.

Event ID 213
Information Store (4168) TEST.NET: The backup procedure has been successfully completed.

1. Modify the portion of the script to specify the source and destination email addresses to send from and to.

2. Copy the contents below and name the file eventmon.vbs

3. Double Click the file. It will continously monitor for the event 213. Therefore you will see wscript process running in task manager process tab. To terminate the job, click end task.

Note: You can download this file from[ James Chong Scripts ]

set objEmail = CreateObject("CDO.Message")

'strComputer=Inputbox("Enter the computer name you want to monitor")
'if strcomputer="" then
strComputer = "."
'end if

set objwmiservice=getobject("winmgmts://" &strcomputer &"/root/cimv2")

strwql="select * " & _
"from __instancecreationevent " & _
"where targetinstance isa 'Win32_NTLogEvent' " & _
"and targetinstance.eventcode = '213' "

set objeventsource=objwmiservice.execnotificationquery(strwql)

wscript.echo "waiting for an event to happen on " &strcomputer

While True
set objeventobject=objeventsource.nextevent()
objEmail.Subject = objEventobject.TargetInstance.ComputerName & _
objEventobject.TargetInstance.logfile & "\" & _
objEmail.From = ""
objEmail.To = ""

objEmail.Textbody = "Computer Name: " & _
objEventobject.TargetInstance.ComputerName & _
"Notification E-Mail from Automated windows event monitoring script." & vbcrlf _
& " Event Type: " & objEventobject.TargetInstance.type & vbcrlf _
& " Event ID: " & objEventobject.TargetInstance.eventcode &vbcrlf _
& " Event source: " & objEventobject.TargetInstance.sourcename & vbcrlf _
& " Event Log: " & objEventobject.TargetInstance.logfile & vbcrlf _
& " Event Time: " & objEventobject.TargetInstance.timewritten & vbcrlf _
& "The Event Err details are :- " & vbcrlf _
& objEventobject.TargetInstance.Message

'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objemail.Configuration.Fields.Item _
("") = 2

'Name or IP of Remote SMTP Server
objemail.Configuration.Fields.Item _
("") = ""

'Server port (typically 25)
objemail.Configuration.Fields.Item _
("") = 25


'==End remote SMTP server configuration section==



James Chong
MCSE M+, S+, MCTS, Security+

How useful was this article? Want to see a tip not listed? Please leave a comment.


Anonymous brijraj said...

Hi James,
It was indeed a vital post for me, i am looking forward to monitor all the incoming msgs at an exchange server 2003, and do something with the msgs for which recepients are not available.

any quick views? i'll appreciate.

thanks and regards


12:19 AM  
Anonymous Alex said...

On as regards backup i know little,but restore-convert a microsoft exchange .ost to .pst,may program for Exchange recovery ost was made to recover Exchange with ost files Outlook 2003,allows to recover all files separately: *.eml, *.vcf and *.txt files will be extracted and placed in the same folder,program is based on effective *.ost files recovery technology, that allows easily convert them to *.pst files, that can be opened by any mail client, compatible with Microsoft Outlook.

4:49 AM  
Anonymous Anonymous said...

For many people, the first type of Men’ Footwear that we believe that during the consideration of Hogan scarpe for men in May of tennis shoes or even a generic cross-training shoes. For others, they believe in May of Hogan scarpe donna , it depends on your background. In fact, this category of hogan donna covers a wide range of sports shoes and leisure activities ranging from golf and basketball and soccer shoes race. I tend to buy Hogan scarpe uomo against training only because I am involved in a wide range of sports and weightlifting, the race to play basketball.

5:21 PM  
Blogger dong dong said...

christian louboutin
oakley sunglasses cheap
christian louboutin outlet
hollister clothing store
ray ban outlet
louis vuitton outlet stores
christian louboutin sale
michael kors bag
cheap lululemon
michael kors outlet online sale
true religion outlet
coco chanel
michael kors handbags
ray ban glasses
red christian louboutin
louis vuitton handbags
michael kors outlet online
coach outlet store online
rolex watches outlet
celine outlet
ray ban sunglasses
cheap jordans
coach factory outlet
jordan 13
hollister clothing
tory burch outlet online
oakley vault
jordan shoes
mont blanc
toms outlet
nfl jerseys

12:38 AM  
Blogger 风骚达哥 said...

20151012 junda
Abercrombie & Fitch Factory Outlet
michael kors outlet
coach factory outlet
michael kors outlet
Louis Vuitton Handbags Factory Store
louis vuitton
Cheap Jordans For Sale Wholesale
oakley sunglasses,oakley vault,prescription sunglasses,polarized sunglasses,aviator sunglasses,spy sunglasses,oakleys,oakley canada,cheap oakley sunglasses,oakley frogskins,oakley holbrook,cheap sunglasses,wayfarer sunglasses,oakley standard issue,fake oakleys,oakley glasses,,oakley prescription glasses,oakley goggles,sunglasses for men,oakley gascan,oakley store,oakleys sunglasses
uggs australia
ugg boots
cheap ugg boots
michael kors handbag
Coach Factory Outlet Online Sale
Louis Vuitton Outlet USA
Air Jordan 4 Toro Bravo
canada goose outlet
toms outlet
New Louis Vuitton Handbags Outlet
Michael Kors Handbags Outlet Deals
michael kors outlet
Wholesale Authentic Designer Handbags
Ugg Boots,Ugg Boots Outlet,Ugg Outlet,Cheap Uggs,Uggs On Sale,Ugg Boots Clearance,Uggs For Women
cheap jordan shoes
michael kors outlet online
louis vuitton handbags
Coach Factory Outlet Private Sale
true religion jeans
Louis Vuitton Bags On Sale
Jordan 13 Shoes For Sale
Ralph Lauren Outlet Clothing

6:20 AM  
Blogger oakleyses said...

louis vuitton outlet, oakley sunglasses, michael kors handbags, cheap jordans, prada handbags, uggs outlet, michael kors outlet, oakley sunglasses, uggs on sale, ray ban sunglasses, burberry outlet, tiffany jewelry, uggs on sale, kate spade, gucci handbags, ray ban sunglasses, prada outlet, longchamp outlet, louboutin uk, burberry factory outlet, tory burch outlet, nike air max, tiffany jewelry, christian louboutin, louboutin shoes, oakley sunglasses, cheap oakley sunglasses, chanel handbags, michael kors outlet store, louis vuitton outlet, nike outlet, ralph lauren polo, louis vuitton, christian louboutin, michael kors outlet online, longchamp outlet, uggs outlet, michael kors outlet online, nike air max, longchamp bags, replica watches, ralph lauren outlet, oakley sunglasses, ray ban sunglasses, louis vuitton outlet online, nike free, michael kors

6:30 PM  
Blogger oakleyses said...

burberry pas cher, lunette oakley pas cher, coach outlet, kate spade outlet, true religion jeans, converse, coach outlet, longchamp soldes, north face uk, michael kors, louboutin pas cher, new balance, lululemon outlet, coach purses, nike air max, hermes pas cher, nike tn pas cher, vans pas cher, coach outlet store online, mulberry uk, lunette ray ban pas cher, nike air max uk, sac guess pas cher, nike air force, nike roshe run pas cher, longchamp pas cher, north face pas cher, nike air max pas cher, ray ban uk, true religion outlet, abercrombie and fitch, polo lacoste pas cher, true religion outlet, michael kors, jordan pas cher, nike free, polo ralph lauren uk, vanessa bruno pas cher, true religion outlet, hogan sito ufficiale, ralph lauren pas cher, michael kors outlet online, nike free pas cher, nike roshe uk, abercrombie and fitch UK, nike blazer pas cher, hollister uk

6:32 PM  
Blogger oakleyses said...

converse shoes outlet, salvatore ferragamo, timberland boots, softball bats, herve leger, ray ban, hollister, louboutin, gucci, nike roshe run, iphone cases, beats by dre, mcm handbags, oakley, p90x workout, insanity workout, wedding dresses, abercrombie and fitch, abercrombie, nike air max, mac cosmetics, babyliss pro, valentino shoes, bottega veneta, mont blanc, converse, jimmy choo outlet, hollister clothing, nike air max, north face outlet, new balance shoes, north face outlet, instyler ionic styler, soccer shoes, lululemon outlet, asics running shoes, ghd hair, giuseppe zanotti, soccer jerseys, nfl jerseys, longchamp uk, reebok outlet, nike air huarache, chi flat iron, hermes handbags, vans outlet, polo ralph lauren, celine handbags, nike trainers uk, vans scarpe

6:34 PM  
Blogger oakleyses said...

toms shoes, supra shoes, montre pas cher, ugg uk, juicy couture outlet, moncler, lancel, michael kors outlet online, ugg pas cher, michael kors handbags, barbour, doke & gabbana, michael kors outlet, coach outlet, louis vuitton uk, canada goose jackets, pandora charms, moncler, ugg,ugg australia,ugg italia, links of london uk, moncler jackets, hollister, juicy couture outlet, canada goose outlet, swarovski uk, pandora jewelry, canada goose pas cher, canada goose outlet, marc jacobs, moncler pas cher, thomas sabo uk, swarovski jewelry, karen millen uk, louis vuitton, moncler, moncler uk, sac louis vuitton, canada goose, moncler outlet, louis vuitton, canada goose, wedding dresses uk, ugg,uggs,uggs canada, canada goose uk, sac louis vuitton, moncler, replica watches, barbour jackets uk, bottes ugg pas cher, canada goose jackets

6:35 PM  
Blogger Junda Xu said...

20151026 junda
michael kors outlet
louis vuitton outlet
nfl jerseys
cheap ugg boots
Coach Factory Outlet Online Sale
air max 95,nike golf,nike janoski,air max 1,nike canada,nike plus,nike shox,nike factory store
Louboutin Red Bottoms Shoes Outlet
oakley sunglasses
louis vuitton outlet
ralph lauren polo
michael kors outlet
michael kors outlet sale
ugg boots
Authentic Louis Vuitton Handbags Cheap Online
mont blanc
michael kors outlet
Gucci Outlet Online Sale
michael kors handbags
Authentic Louis Vuitton Belts Outlet Store
michael kors outlet
Coach Factory Outlet Private Sale
true religion jeans
tory burch outlet
Oakley Vault Outlet Store Online
hollister clothing store
nike trainers
Louis Vuitton Handbags Official Site
michael kors handbag
Louis Vuitton Handbags Factory Store
uggs australia

1:23 AM  
Blogger Minko Chen said...

adidas outlet
soccer jerseys wholesale
michael kors handbags
mulberry outlet store
prada outlet
cheap nba jerseys
ralph lauren uk
swarovski crystal
oakley sunglasses wholesale
chanel handbags outlet
ralph lauren outlet
cheap jordan shoes
canada goose coats
toms outlet store
puma outlet
north face outlet store
ugg boots
black friday deals
ugg outlet
toms outlet

6:45 PM  

Post a Comment

<< Home

xml:lang="en" lang="en"> MS Exchange Tips: Exchange: Event Monitoring Via WMI (Backup Report)