Win32_PerfRawData_SMTPSVC_SMTPServer vbscript sample code
The foundations for Manageability in Windows is Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).
ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself. The Win32_PerfRawData_SMTPSVC_SMTPServer WMI class can be used in ActiveXperts Network Monitor to monitor your servers.
Description
The Win32_PerfRawData_SMTPSVC_SMTPServer raw data performance counter classes represents the raw data counters specific to the SMTP Server. This class is found only on server operating systems. This class is shown as the SMTP Server object in System Monitor. The WMI source of its data is the high-performance Performance Counter Provider. The original data source is the SMTPSVC performance library. The corresponding formatted data class is Win32_PerfFormattedData_SMTPSVC_SMTPServer. This class was added for Windows 2000.
Sample Code
On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_SMTPSVC_SMTPServer",,48) For Each objItem in colItems Wscript.Echo "AvgRecipientsPermsgReceived: " & objItem.AvgRecipientsPermsgReceived Wscript.Echo "AvgRecipientsPermsgReceived_Base: " & objItem.AvgRecipientsPermsgReceived_Base Wscript.Echo "AvgRecipientsPermsgSent: " & objItem.AvgRecipientsPermsgSent Wscript.Echo "AvgRecipientsPermsgSent_Base: " & objItem.AvgRecipientsPermsgSent_Base Wscript.Echo "AvgRetriesPermsgDelivered: " & objItem.AvgRetriesPermsgDelivered Wscript.Echo "AvgRetriesPermsgDelivered_Base: " & objItem.AvgRetriesPermsgDelivered_Base Wscript.Echo "AvgRetriesPermsgSent: " & objItem.AvgRetriesPermsgSent Wscript.Echo "AvgRetriesPermsgSent_Base: " & objItem.AvgRetriesPermsgSent_Base Wscript.Echo "BadmailedMessagesBadPickupFile: " & objItem.BadmailedMessagesBadPickupFile Wscript.Echo "BadmailedMessagesGeneralFailure: " & objItem.BadmailedMessagesGeneralFailure Wscript.Echo "BadmailedMessagesHopCountExceeded: " & objItem.BadmailedMessagesHopCountExceeded Wscript.Echo "BadmailedMessagesNDRofDSN: " & objItem.BadmailedMessagesNDRofDSN Wscript.Echo "BadmailedMessagesNoRecipients: " & objItem.BadmailedMessagesNoRecipients Wscript.Echo "BadmailedMessagesTriggeredviaEvent: " & objItem.BadmailedMessagesTriggeredviaEvent Wscript.Echo "BytesReceivedPersec: " & objItem.BytesReceivedPersec Wscript.Echo "BytesReceivedTotal: " & objItem.BytesReceivedTotal Wscript.Echo "BytesSentPersec: " & objItem.BytesSentPersec Wscript.Echo "BytesSentTotal: " & objItem.BytesSentTotal Wscript.Echo "BytesTotal: " & objItem.BytesTotal Wscript.Echo "BytesTotalPersec: " & objItem.BytesTotalPersec Wscript.Echo "Caption: " & objItem.Caption Wscript.Echo "CatAddresslookupcompletions: " & objItem.CatAddresslookupcompletions Wscript.Echo "CatAddresslookupcompletionsPersec: " & objItem.CatAddresslookupcompletionsPersec Wscript.Echo "CatAddresslookups: " & objItem.CatAddresslookups Wscript.Echo "CatAddresslookupsnotfound: " & objItem.CatAddresslookupsnotfound Wscript.Echo "CatAddresslookupsPersec: " & objItem.CatAddresslookupsPersec Wscript.Echo "CatCategorizationscompleted: " & objItem.CatCategorizationscompleted Wscript.Echo "CatCategorizationscompletedPersec: " & objItem.CatCategorizationscompletedPersec Wscript.Echo "CatCategorizationscompletedsuccessfully: " & objItem.CatCategorizationscompletedsuccessfully Wscript.Echo "CatCategorizationsfailedDSconnectionfailure: " & objItem.CatCategorizationsfailedDSconnectionfailure Wscript.Echo "CatCategorizationsfailedDSlogonfailure: " & objItem.CatCategorizationsfailedDSlogonfailure Wscript.Echo "CatCategorizationsfailednonretryableerror: " & objItem.CatCategorizationsfailednonretryableerror Wscript.Echo "CatCategorizationsfailedOutOfMemory: " & objItem.CatCategorizationsfailedOutOfMemory Wscript.Echo "CatCategorizationsfailedretryableerror: " & objItem.CatCategorizationsfailedretryableerror Wscript.Echo "CatCategorizationsfailedsinkretryableerror: " & objItem.CatCategorizationsfailedsinkretryableerror Wscript.Echo "CatCategorizationsinprogress: " & objItem.CatCategorizationsinprogress Wscript.Echo "CategorizerQueueLength: " & objItem.CategorizerQueueLength Wscript.Echo "CatLDAPbindfailures: " & objItem.CatLDAPbindfailures Wscript.Echo "CatLDAPbinds: " & objItem.CatLDAPbinds Wscript.Echo "CatLDAPconnectionfailures: " & objItem.CatLDAPconnectionfailures Wscript.Echo "CatLDAPconnections: " & objItem.CatLDAPconnections Wscript.Echo "CatLDAPconnectionscurrentlyopen: " & objItem.CatLDAPconnectionscurrentlyopen Wscript.Echo "CatLDAPgeneralcompletionfailures: " & objItem.CatLDAPgeneralcompletionfailures Wscript.Echo "CatLDAPpagedsearchcompletionfailures: " & objItem.CatLDAPpagedsearchcompletionfailures Wscript.Echo "CatLDAPpagedsearches: " & objItem.CatLDAPpagedsearches Wscript.Echo "CatLDAPpagedsearchescompleted: " & objItem.CatLDAPpagedsearchescompleted Wscript.Echo "CatLDAPpagedsearchfailures: " & objItem.CatLDAPpagedsearchfailures Wscript.Echo "CatLDAPsearchcompletionfailures: " & objItem.CatLDAPsearchcompletionfailures Wscript.Echo "CatLDAPsearches: " & objItem.CatLDAPsearches Wscript.Echo "CatLDAPsearchesabandoned: " & objItem.CatLDAPsearchesabandoned Wscript.Echo "CatLDAPsearchescompleted: " & objItem.CatLDAPsearchescompleted Wscript.Echo "CatLDAPsearchescompletedPersec: " & objItem.CatLDAPsearchescompletedPersec Wscript.Echo "CatLDAPsearchespendingcompletion: " & objItem.CatLDAPsearchespendingcompletion Wscript.Echo "CatLDAPsearchesPersec: " & objItem.CatLDAPsearchesPersec Wscript.Echo "CatLDAPsearchfailures: " & objItem.CatLDAPsearchfailures Wscript.Echo "Catmailmsgduplicatecollisions: " & objItem.Catmailmsgduplicatecollisions Wscript.Echo "CatMessagesaborted: " & objItem.CatMessagesaborted Wscript.Echo "CatMessagesbifurcated: " & objItem.CatMessagesbifurcated Wscript.Echo "CatMessagesCategorized: " & objItem.CatMessagesCategorized Wscript.Echo "CatMessagessubmitted: " & objItem.CatMessagessubmitted Wscript.Echo "CatMessagessubmittedPersec: " & objItem.CatMessagessubmittedPersec Wscript.Echo "CatRecipientsaftercategorization: " & objItem.CatRecipientsaftercategorization Wscript.Echo "CatRecipientsbeforecategorization: " & objItem.CatRecipientsbeforecategorization Wscript.Echo "CatRecipientsincategorization: " & objItem.CatRecipientsincategorization Wscript.Echo "CatRecipientsNDRdambiguousaddress: " & objItem.CatRecipientsNDRdambiguousaddress Wscript.Echo "CatRecipientsNDRdbycategorizer: " & objItem.CatRecipientsNDRdbycategorizer Wscript.Echo "CatRecipientsNDRdforwardingloop: " & objItem.CatRecipientsNDRdforwardingloop Wscript.Echo "CatRecipientsNDRdillegaladdress: " & objItem.CatRecipientsNDRdillegaladdress Wscript.Echo "CatRecipientsNDRdsinkreciperrors: " & objItem.CatRecipientsNDRdsinkreciperrors Wscript.Echo "CatRecipientsNDRdunresolved: " & objItem.CatRecipientsNDRdunresolved Wscript.Echo "CatSendersunresolved: " & objItem.CatSendersunresolved Wscript.Echo "CatSenderswithambiguousaddresses: " & objItem.CatSenderswithambiguousaddresses Wscript.Echo "ConnectionErrorsPersec: " & objItem.ConnectionErrorsPersec Wscript.Echo "CurrentMessagesinLocalDelivery: " & objItem.CurrentMessagesinLocalDelivery Wscript.Echo "Description: " & objItem.Description Wscript.Echo "DirectoryDropsPersec: " & objItem.DirectoryDropsPersec Wscript.Echo "DirectoryDropsTotal: " & objItem.DirectoryDropsTotal Wscript.Echo "DNSQueriesPersec: " & objItem.DNSQueriesPersec Wscript.Echo "DNSQueriesTotal: " & objItem.DNSQueriesTotal Wscript.Echo "ETRNMessagesPersec: " & objItem.ETRNMessagesPersec Wscript.Echo "ETRNMessagesTotal: " & objItem.ETRNMessagesTotal Wscript.Echo "Frequency_Object: " & objItem.Frequency_Object Wscript.Echo "Frequency_PerfTime: " & objItem.Frequency_PerfTime Wscript.Echo "Frequency_Sys100NS: " & objItem.Frequency_Sys100NS Wscript.Echo "InboundConnectionsCurrent: " & objItem.InboundConnectionsCurrent Wscript.Echo "InboundConnectionsTotal: " & objItem.InboundConnectionsTotal Wscript.Echo "LocalQueueLength: " & objItem.LocalQueueLength Wscript.Echo "LocalRetryQueueLength: " & objItem.LocalRetryQueueLength Wscript.Echo "MessageBytesReceivedPersec: " & objItem.MessageBytesReceivedPersec Wscript.Echo "MessageBytesReceivedTotal: " & objItem.MessageBytesReceivedTotal Wscript.Echo "MessageBytesSentPersec: " & objItem.MessageBytesSentPersec Wscript.Echo "MessageBytesSentTotal: " & objItem.MessageBytesSentTotal Wscript.Echo "MessageBytesTotal: " & objItem.MessageBytesTotal Wscript.Echo "MessageBytesTotalPersec: " & objItem.MessageBytesTotalPersec Wscript.Echo "MessageDeliveryRetries: " & objItem.MessageDeliveryRetries Wscript.Echo "MessagesCurrentlyUndeliverable: " & objItem.MessagesCurrentlyUndeliverable Wscript.Echo "MessagesDeliveredPersec: " & objItem.MessagesDeliveredPersec Wscript.Echo "MessagesDeliveredTotal: " & objItem.MessagesDeliveredTotal Wscript.Echo "MessageSendRetries: " & objItem.MessageSendRetries Wscript.Echo "MessagesPendingRouting: " & objItem.MessagesPendingRouting Wscript.Echo "MessagesReceivedPersec: " & objItem.MessagesReceivedPersec Wscript.Echo "MessagesReceivedTotal: " & objItem.MessagesReceivedTotal Wscript.Echo "MessagesRefusedforAddressObjects: " & objItem.MessagesRefusedforAddressObjects Wscript.Echo "MessagesRefusedforMailObjects: " & objItem.MessagesRefusedforMailObjects Wscript.Echo "MessagesRefusedforSize: " & objItem.MessagesRefusedforSize Wscript.Echo "MessagesSentPersec: " & objItem.MessagesSentPersec Wscript.Echo "MessagesSentTotal: " & objItem.MessagesSentTotal Wscript.Echo "Name: " & objItem.Name Wscript.Echo "NDRsGenerated: " & objItem.NDRsGenerated Wscript.Echo "NumberofMailFilesOpen: " & objItem.NumberofMailFilesOpen Wscript.Echo "NumberofQueueFilesOpen: " & objItem.NumberofQueueFilesOpen Wscript.Echo "OutboundConnectionsCurrent: " & objItem.OutboundConnectionsCurrent Wscript.Echo "OutboundConnectionsRefused: " & objItem.OutboundConnectionsRefused Wscript.Echo "OutboundConnectionsTotal: " & objItem.OutboundConnectionsTotal Wscript.Echo "PercentRecipientsLocal: " & objItem.PercentRecipientsLocal Wscript.Echo "PercentRecipientsLocal_Base: " & objItem.PercentRecipientsLocal_Base Wscript.Echo "PercentRecipientsRemote: " & objItem.PercentRecipientsRemote Wscript.Echo "PercentRecipientsRemote_Base: " & objItem.PercentRecipientsRemote_Base Wscript.Echo "PickupDirectoryMessagesRetrievedPersec: " & objItem.PickupDirectoryMessagesRetrievedPersec Wscript.Echo "PickupDirectoryMessagesRetrievedTotal: " & objItem.PickupDirectoryMessagesRetrievedTotal Wscript.Echo "RemoteQueueLength: " & objItem.RemoteQueueLength Wscript.Echo "RemoteRetryQueueLength: " & objItem.RemoteRetryQueueLength Wscript.Echo "RoutingTableLookupsPersec: " & objItem.RoutingTableLookupsPersec Wscript.Echo "RoutingTableLookupsTotal: " & objItem.RoutingTableLookupsTotal Wscript.Echo "Timestamp_Object: " & objItem.Timestamp_Object Wscript.Echo "Timestamp_PerfTime: " & objItem.Timestamp_PerfTime Wscript.Echo "Timestamp_Sys100NS: " & objItem.Timestamp_Sys100NS Wscript.Echo "TotalConnectionErrors: " & objItem.TotalConnectionErrors Wscript.Echo "TotalDSNFailures: " & objItem.TotalDSNFailures Wscript.Echo "Totalmessagessubmitted: " & objItem.Totalmessagessubmitted Next