Results 1 to 3 of 3

Thread: WMI Task & Connection

  1. #1
    Join Date
    Nov 2006
    Posts
    2

    WMI Task & Connection

    It looks like WMI reader task has lot of problems. Here is what I have found

    It does not allow to dynamically change the ServerName using Expression.(I used a work around in Script task to change the ConnectionString property during runtime)
    WQL language for WMI does not filter data perfectly using date criteria.
    If there is no data for the given query, it fails with the following error message Operation is not valid due to the current state of the object.
    Your comments for the above points will be greatly appreciated.

    Thanks
    Shafiq

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Could you please post the code in this thread. Let us a take a look on whats going on.

  3. #3
    Join Date
    Nov 2006
    Posts
    2

    Thumbs up

    For Point1,
    In the WMI connection,
    I used the expression editor to assign the ServerName dynamically like
    Expression for WMI Connection is like that

    Expression

    ServerName @[User::WMIConnection]

    I have verified the my @[User::WMIConnection] variable has the proper server name like \\servername but it is not poulating the serverName filed of WMI connection. I used workaround to use Script Task to set the ConnectionString property.

    For Point2,
    I want only data for 20061108 but this also includes the data for 20061107 too.

    SELECT ComputerName, Logfile, RecordNumber, Category, CategoryString, EventCode, EventIdentifier, EventType, Message, SourceName, TimeGenerated, TimeWritten, Type, User FROM Win32_NTLogEvent Where LogFile = 'System' and ( TimeWritten >= '20061108' and TimeWritten < '20061109' )

    For Point3,
    If there is no data using the above query, it will fail with Operation is not valid due to the current state of the object
    I want my package to continue as I have to query the log for 10 different servers if this condition occurs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •