WMI Date/Time issues when querying the Event Log

  • Having a nightmare querying the Application Log through SSIS WMI Data Reader.

    Basically I am kicking off a service on another server that runs and then throws a SUCCESS or FAIL message to the event viewer. I can pick up the records using > current date with 000000 on as the time but it will not always run the moment I specify a time.

    Sample -

    SELECT * FROM Win32_NTLogEvent WHERE LogFile = 'Application' AND SourceName='DataService' AND Message LIKE '%terminated SUCCESS%' AND TimeGenerated > '20110421000000.000000+000'

    That works - but brings back multiple records for the same date. I need to get the most recent iteration so I need to capture the current datetime before kicking off the service, convert to UTC format, and then use this in the query. But various times do not work. I cannot specify for example '20110421120000.000000+000' (midday) but I can specify '20110421100000.000000+000' (10 am)

    Additionally I am not yet being able to convert to UTC on the fly (I've tried mucking around with the SWbemDateTime object but can't seem to get it picked up within SSIS script task)

    Can someone assist me please? Its driving me nuts!

  • Sadly due to time constraints I'm abandoning this approach but if anyone does know the answer please do tell (or in future I'll investigate and update my findings)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply