Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Create a Permanent Event ConsumerContent of Create a Permanent Event Consumer.vbsMD5 Hash: 95911D7081F7E7FFCF22BE910C2BAF5A |
||
' Description: Creates a permanent event consumer for monitoring changes in service status.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default") Set objConsumerType = objWMIService.get("SMTPEventConsumer") Set objConsumer = objConsumerType.SpawnInstance_ objConsumer.Name = "Service Monitor Consumer" objConsumer.Message = "A service has changed state." objConsumer.SMTPServer = "mailserver.fabrikam.com" objConsumer.Subject = "Service state change" objConsumer.ToLine = "administrator@fabrikam.com" objConsumer.Put_ | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |