Showing posts with label query. Show all posts
Showing posts with label query. Show all posts

6/27/2011

SCCM Asset Intelligence - List manufacturer friendly names

This Query will list all possible manufacturer listings of an application and the friendly names (grouped)

SELECT Distinct CommonPublisher,Publisher
FROM v_LU_SoftwareList
INNER JOIN V_LU_Softwarehash ON V_LU_Softwarehash.SoftwareID = v_LU_SoftwareList.SoftwareID
ORDER BY CommonPublisher

8/18/2010

SCCM SQL Query - Get all Computer objects which are not member of a specific collection and it's subcollections

This SQL query will return each computer which is not member of your defined collection and it's subcollections

select Name0 From v_R_System Where v_R_System.Name0 not in(
select v_R_System.Name0 from v_R_System inner join v_ClientCollectionMembers on (v_R_System.ResourceID = v_ClientCollectionMembers.ResourceID)
inner join v_CollectToSubCollect on (v_CollectToSubCollect.subCollectionID = v_ClientCollectionMembers.CollectionID)
Where v_CollectToSubCollect.parentCollectionID = 'YourCollectionID')
order By Name0


It's also possible with muliple start collection

select Name0 From v_R_System Where v_R_System.Name0 not in(
select v_R_System.Name0 from v_R_System inner join v_ClientCollectionMembers on (v_R_System.ResourceID = v_ClientCollectionMembers.ResourceID)
inner join v_CollectToSubCollect on (v_CollectToSubCollect.subCollectionID = v_ClientCollectionMembers.CollectionID)
Where v_CollectToSubCollect.parentCollectionID In('YourCollectionID1','YourCollectionID2','YourCollectionID3'))
Order By Name0