Client Management Suite

 View Only
  • 1.  SQL query to list computers associated to policy

    Posted Dec 08, 2011 02:20 PM
      |   view attached

    Hi,

    Need SQL help.

    I need a sql query that list all computers associated to the Policy.We can use policy name or policy guid on the sql query.

    I am not able to get the right query to list the computers.

    I am attaching screenshot for reference as well.

     

    Any help is appreciated



  • 2.  RE: SQL query to list computers associated to policy

    Posted Dec 08, 2011 03:02 PM

     

    SELECT *
    FROM vComputer vc
    JOIN ItemAppliesTo it
       ON it.ResourceTargetGuid = vc.Guid
    WHERE it.ItemGuid = '<GUID>'
     
    GUID would be the Policy Guid


  • 3.  RE: SQL query to list computers associated to policy

    Posted Dec 08, 2011 09:34 PM

    Not returning values.

    I used below query to return GUID for all Managed software delivery policies. Then i tried it on your command, No values are returning. 

    I am using Altiris 7.1 Version

     

    select Guid, Name from vitem where ClassGuid = '2D3A170E-5028-4570-BA0C-3DB775CB8BDE' order by Name asc

     

    Appreciate your help
     



  • 4.  RE: SQL query to list computers associated to policy
    Best Answer

    Broadcom Employee
    Posted Dec 09, 2011 03:25 AM

    Try this one:

    SELECT vc.Name FROM ResourceTargetMembershipCache vtm

    JOIN ItemAppliesTo it

    ON it.ResourceTargetGuid = vtm.ResourceTargetGuid

    join vComputer vc

    on vtm.ResourceGuid = vc.Guid

    WHERE it.ItemGuid = <Policy GUID>

     



  • 5.  RE: SQL query to list computers associated to policy

    Posted Dec 09, 2011 06:17 PM

    Thanks a lot Alex.

    This is what I am looking for