Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rcarlson/nooutlookforalerts.asp
Pretty slick! By the way, you know that MAPI is a goner in 2005?
All the best,
Author: An Introduction to SQL Server 2005 Management Studio
One more thing: Isn't it possible to filter also on the DATE in the query?
btw: Very nice script!
Sorry, but I cannot find Win32_NTLogEvent anywhere. What is it - an mssql table, a file?
Good article. Just proves there is more than one way to skin a cat
"I cannot find Win32_NTLogEvent anywhere"
This is a WMI class. There is a whole bunch of them in Windows http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_reference.asp
"...you know that MAPI is a goner in 2005"
Well it's not actually gone, it's still there but you have the option of using a new thing called DatabaseMail which is SMTP based. Realistically, I don't know that many DBA's given the option would use SQL Mail and rely on MAPI and Exchange.
Colt 45 - the original point and click interface
If you go to command prompt and type in wbemtest and enter.
Change the location from:
root\default to root\cimv2 and hit login
Hit enumerate classes, use recursive radio button, hit ok
You will no have a list of all the classes and their properties. You can scroll down to Win_NTLogEvent to see the properties in the middle window.
Or you can cut and paste this script as ClassInfo.vbs
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
On Error Resume Next
arrComputers = Array(".")
For Each strComputer In arrComputers
WScript.Echo "Computer: " & strComputer
strClass = "Win32_NTEventLog"
Get objWMIService = _
Set colClasses = objWMIService.ExecQuery("SELECT * FROM " & strClass, "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
i = 0
For Each objClass In colClasses
i = i + 1
If i = 1 Then
WScript.Echo "* Properties *"
For Each objProperty In objClass.Properties_
WScript.Echo vbNewLine & "* Methods *"
For Each objMethod In objClass.Methods_
Hope this helps
Sorry the line strClass = "Win32_NTEventLog"
strClass = "Win32_NTLogEvent"
Hall of Fame
There are several lines in Alert.vbs that reference Microsoft's site. If my SQL server does not have HTTP access do the web what are my options here? Thanks.
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'name of notesserverhost ?
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
No http - no go.
You could redirect the output to open an instance of word, excel, etc., then use this accross the lan but there are some issues with this especially with XP, SP2. I will consider this for a future article.
I get this error when I try and run the script. Any thoughts.
[Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error
Viewing 10 posts - 1 through 9 (of 9 total)