I am attempting to build collections based on their patch status. For example, if a machine is missing MS patch MS04-041 it will be placed in a specific collection. I built the following SQL query to provide the information I need:
The problem I'm having is actually building the collection because SMS keeps telling the query isn't valid (it runs perfectly in SQL QA). I'm assuming it isn't valid because it isn't WQL. Is this correct? If so, how do I port this query into WQL format? If not, what am I missing?
Thanks in advance.
-If it ain't broke, break it and make it better.
Code:
select sys.Netbios_Name0
from v_R_System sys
join v_FullCollectionMembership fcm on sys.ResourceID=fcm.ResourceID
join v_GS_PatchStatus ps on sys.ResourceID=ps.ResourceID
where fcm.CollectionID = 'BOP0001A' and ps.LastState != 105 and ps.id = 'MS04-041'
The problem I'm having is actually building the collection because SMS keeps telling the query isn't valid (it runs perfectly in SQL QA). I'm assuming it isn't valid because it isn't WQL. Is this correct? If so, how do I port this query into WQL format? If not, what am I missing?
Thanks in advance.
-If it ain't broke, break it and make it better.