Client Management Suite

 View Only

Creating a dynamic drop down report of the membership of any filter 

Apr 01, 2016 11:30 AM

It can be helpful to run reports of the membership of any filter as reports offer you the ability to add in additional data as well as export them to CSV for further processing. 

Here is one way to do that:

  1. Make a report that lists all of the filters in your Altiris environment
    1. In reports right click and choose NEW > REPORT >SQL report
    2. Delete the contents of SQL query
    3. Change the name at the top to All filters
    4. Input the following SQL
    5. SELECT
       DISTINCT [vCollection].[Name] AS [Filter Name]
      FROM
         [vRM_Computer_Item] AS [vri3_Computer] INNER JOIN
       
      CollectionMembership ON CollectionMembership.ResourceGuid = vri3_Computer.Guid INNER JOIN
       
      vCollection INNER JOIN
       
      Collection ON vCollection.Guid = Collection.Guid ON CollectionMembership.CollectionGuid = Collection.Guid
      
      ORDER BY [vCollection].[Name]

       

    6. When you run this report you will see a list of all the filters in Altiris that have computers in them.

  2. Make a drop down report that references this report

    1. In reports right click and choose NEW > Report > SQL report
    2. Change the name at the top to members of any filter
    3. In report parameters choose Add > New parameter
    4. Change the name of the parameter to filterName
    5. Change the description of the parameter to filterName
    6. Change the label text to "Choose the filter to view"
    7. Change the Value provider to Dropdown list Value Edit control
    8. Choose Add Dropdown Values from A Report
    9. In the select Report field choose "all filters"
    10. The report field to display should be automatically populated
    11. In the main report creation window choose the Data source tab
    12. In the lower tab row select "Query parameters"
    13. Go to the "fields" tab and add the fields you want to see about each computer in this report.
    14. As an example I will choose IP and computer model but you can add any number of fields that you want (we use a ton of them in our production version of this report
    15. Save the report
    16. Re open the report and choose "Convert this query to SQL"
    17. You need to add some SQL to get the filter memberships of each computer and to match that against the drop down filter
      1. At the bottom of the select statement add a comma on the last item
      2. Then add  "[vCollection].[Name] AS [Filter Name]"
      3. Add the following join below the line "[vRM_Computer_Item] AS [vri3_Computer]"
      4.  
        INNER JOIN
         
        CollectionMembership ON CollectionMembership.ResourceGuid = vri3_Computer.Guid INNER JOIN
         
        vCollection INNER JOIN
         
        Collection ON vCollection.Guid = Collection.Guid ON CollectionMembership.CollectionGuid = Collection.Guid

         

      5. Finally right below the WHERE section add the following line "  ( [vCollection].[Name]  LIKE @v1_filterName)  AND "
      6. Here is the full example query:
      7.  
        DECLARE @v1_filterName nvarchar(max)
           SET @v1_filterName = N'%filterName%'
        DECLARE @v2_TrusteeScope nvarchar(max)
           SET @v2_TrusteeScope = N'%TrusteeScope%'
        SELECT
           [vri3_Computer].[Guid] AS [_ItemGuid],
           [vri3_Computer].[Name],
           [dca4_AeX AC TCPIP].[IP Address],
           [dca5_Manufacturer].[Model],
        [vCollection].[Name] AS [Filter Name]
        FROM
           [vRM_Computer_Item] AS [vri3_Computer]
        INNER JOIN
         
        CollectionMembership ON CollectionMembership.ResourceGuid = vri3_Computer.Guid INNER JOIN
         
        vCollection INNER JOIN
         
        Collection ON vCollection.Guid = Collection.Guid ON CollectionMembership.CollectionGuid = Collection.Guid
              LEFT OUTER JOIN [Inv_AeX_AC_TCPIP] AS [dca4_AeX AC TCPIP]
                 ON ([vri3_Computer].[Guid] = [dca4_AeX AC TCPIP].[_ResourceGuid])
              LEFT OUTER JOIN [Inv_Manufacturer] AS [dca5_Manufacturer]
                 ON ([vri3_Computer].[Guid] = [dca5_Manufacturer].[_ResourceGuid])
        WHERE
        
          ( [vCollection].[Name]  LIKE @v1_filterName)
        AND
           (
              ([vri3_Computer].[Guid] IN (SELECT [ResourceGuid] FROM [ScopeMembership] WHERE [ScopeCollectionGuid] IN (SELECT [ScopeCollectionGuid] FROM dbo.fnGetTrusteeScopeCollections(@v2_TrusteeScope))))
           )
        

         

  3. Now you will be able to select any filter and get details about the computers in it.  
  4. Using the dropdown:
  5. Filters5.png
  6. You can view whatever details you added (i obfuscated the computer names and IPs in mine:
  7. Filters6.png

NOTE: Running a report against them does not refresh a filter.  So if you need up the minute accuracy refresh the filter first. 

Let me know if this helps anyone

 

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Apr 02, 2016 02:58 PM

Thanks Igor.  I just did that  everyone who uses Altiris should have this report.  We use it and permutations of it all the time.

For example we name all the adobe creative suite deployment filters with a particular prefix and the SQL of this report can be taylored to only show filters with that prefix making an awesome dashboard to show the status of each deployment.

Apr 01, 2016 01:20 PM

Why you didn't attach a ready .xml file of this report? This will be easier to others just to import this .xml and have this report in their environment.

Related Entries and Links

No Related Resource entered.