Client Management Suite

 View Only
  • 1.  How to Automatically update filters with SQL Query

    Posted Jun 04, 2014 12:03 PM

    In 7.1 only filters associated with a task, job, or policy update with the resource membership updates. We use filters for reporting as well and we'd like to put our other custom filters on a schedule to update. We tried create a filter membership update task but that only updates the resources within the filters and we need to update the actual filters. Here is the sql we are using to identify our custom filters which haven't updated in the last 2 hours which we'd like to update on a schedule. Anyone know how to do this?

    SELECT v1.GUID, v1.Name, v1.Description, v2.modifieddate FROM vCollection v1

    join Collection v2
    on v1.Guid = v2.Guid

    WHERE v1.ProductGuid = 'D0E33520-C160-11D2-8612-00104B74A9DF'
    AND(v1.Attributes = 0)

    groupby v1.guid, v1.name, v1.description, v2.modifieddate

    HAVING NOT DATEDIFF (hh, v2.modifieddate, getdate()) < 2

    ORDERBY [Name]



  • 2.  RE: How to Automatically update filters with SQL Query

    Trusted Advisor
    Posted Jun 04, 2014 01:03 PM
      |   view attached

    There is a built-in Task to update filter membership.

    See the attached screenshot.



  • 3.  RE: How to Automatically update filters with SQL Query

    Trusted Advisor
    Posted Jun 05, 2014 10:17 AM

    If you don't like that first response you can also create an active policy to do something and schedule it for like 20 years from now, and assign it to all of the filters that you want to keep updated.



  • 4.  RE: How to Automatically update filters with SQL Query

    Posted Jun 05, 2014 11:35 PM

    There is also an ASDK method that you can use.



  • 5.  RE: How to Automatically update filters with SQL Query

    Posted Jun 06, 2014 05:36 PM

    What you could do is:

    1. Run Altiris Profiler

    2. Update one filter

    3. Stop Altiris Profiler

    4. Look for sql code that was gathered by Altiris Profiler

    I found a number of stored procedures. But none single one seems to do the work. Here is a few of them.

    SELECT BaseClassGuid FROM ClassBaseClass WHERE ClassGuid = ( SELECT ic.ClassGuid FROM ItemClass ic INNER JOIN vInstalledItem ii ON ic.Guid = ii.Guid WHERE ic.Guid = '7624d1e2-5e21-4bf3-8226-13ea5ef5a30e' )
    EXECUTE spItemClassGet @Guid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spItemLoad @NameRef=N'item.name', @DescriptionRef=N'item.description', @Guid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e', @Culture=N'en-US', @InUpgrade=0, @IsLocalisable=1, @IsResource=0
    EXECUTE spItemNSSourceSelect @ItemGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spNSResourceCollectionBaseLoad @CollectionGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spCollectionIncludeResourceGet @CollectionGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spCollectionExcludeResourceGet @CollectionGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spCollectionIncludeCollectionGet @CollectionGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'
    EXECUTE spCollectionExcludeCollectionGet @CollectionGuid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'

    EXECUTE spIsHierarchyManagedItem1 @Guid='7624d1e2-5e21-4bf3-8226-13ea5ef5a30e'

    It looks like simple task update filter task on console is a little bit more complex job in database.