List Machines only in the Default Software Update Plug-In Policy
search cancel

List Machines only in the Default Software Update Plug-In Policy

book

Article ID: 184764

calendar_today

Updated On:

Products

Patch Management Solution

Issue/Introduction

How I can check what machines are targeted by the Default Software Agent Plug-In Policy?

Environment

Patch Management Solution 8.x

Resolution

Following SQL query will return those machines only targeted by the Default Software Agent Plug-In Policy:

select distinct

vc.Guid,

vc.Name as Computer,

i1.name as Policy,

case when ia.Enabled = 1 then 'Yes' else '' end as [Enabled],

i2.name as [Target],

c.Type as [Policy Type],

i1.Guid as PolicyGuid,

rtc.ResourceTargetGuid

 

from ItemAppliesTo iat

join vItem i1 on i1.Guid = iat.ItemGuid

join vItem i2 on i2.Guid = iat.ResourceTargetGuid

join Class c on c.Guid = i1.ClassGuid

join ItemActive ia on ia.Guid = iat.ItemGuid and ia.Enabled = 1

join ResourceTargetMembershipCache rtc on rtc.ResourceTargetGuid = iat.ResourceTargetGuid

join vRM_Computer_Item vc on vc.Guid = rtc.ResourceGuid

 

where c.Guid = '5E5BDE22-C290-4A94-A36C-C5076DA6D565'

and vc.Guid not in

         (select distinct vc.Guid

                 from ItemAppliesTo iat

            join vItem i1 on i1.Guid = iat.ItemGuid

            join vItem i2 on i2.Guid = iat.ResourceTargetGuid

            join Class c on c.Guid = i1.ClassGuid

            join ItemActive ia on ia.Guid = iat.ItemGuid and ia.Enabled = 1

            join ResourceTargetMembershipCache rtc on rtc.ResourceTargetGuid = iat.ResourceTargetGuid

            join vRM_Computer_Item vc on vc.Guid = rtc.ResourceGuid

                 where c.Guid = '5E5BDE22-C290-4A94-A36C-C5076DA6D565'

            and i1.guid <> '0D1CB0D4-B256-44DA-A74D-D7FB68364D29')

 

order by vc.Name