Documente Academic
Documente Profesional
Documente Cultură
com
www.Paddymaddy.com
1. All Client systems 2. ALL Non client systems 3. ALL Inactive systems 4. All Obsolete system 5. Computers with two records one with Yes and other With NO / Duplicate client Yes or No 6. Last hardware inventory 14 days 7. Last software inventory 14 days 8. Last Data discovery cycle. 9. List only XYZ package, XYZ Advertisement success systems collection 10. List only XYZ package, XYZ Advertisement Failed systems collection 11. List only XYZ subnet collection system .with more examples like IP based..etc.. 12. If systems found in XYZ collection then add to ABC Collection 13. All SMS server system collection.. like based on SMS/SCCM Roles..like MP,DP,SLPetc.. 14. Creating collection for All windows server, workstation, DP, BDP collection More are similar to above 13th point huh 15. All systems with AD site Name based like Dubai AD site 16. Collection limiting to sub collection, linking How to link a collection with other collection as a sub collection.. 17. Systems are in A collection but not in B Collection & Vice versa 18. Create a collection based on XYZ Software installed systems 19. In collection XYZ File inventory (s\w inventory based) installed system 20. In collection XYZ file specific method (H\w inventory based) system 21. XYZ patch Installed & Not Installed system Document created by Paddymaddy Version 1.0 Email me : paddy@paddymaddy.com www.paddymaddy.com
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com 22. All windows update Agent version 7.6 below 23. XYZ user/group collection (COLLECTION OF COMPUTERS BASED ON USERS) 24. Workstation computers that have not restarted the last 7 days 25. All Clients without a SCCM Client installed (All Non Client Systems collection) 26. All Unapproved clients 27. Old version of SCCM Clients Collection 28. Patching Collections a).All computers that are in a state of pending restart b).All computers that failed to install an update c).All computers that are waiting for another installation to complete 29. Local Client Systems 30. for software distribution status if system pending for reboot 31. Create a collection with systems without Adobe Reader 9 32. Creating a non-Compliance collection for remediation (in DCM) 33. Systems part of what all collections: 34. Only Desktops in collection 34. SCCM / SMS Console Installed Systems Collection 35. All Required Patches in a specific collection systems 36. How to find all Collections WQL Query and collection ID and Names in the SQL ? 37. how to find all collection ID's from SQL ?
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com LastLogonUserName, SMSUniqueIdentifier, ResourceId, ResourceType, NetbiosName from sms_r_system where Client = 1
3.Inactive systems
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMS UniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Active = 0
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_WORKSTATION_STATUS.LastHardwareScan >= DateAdd(dd,-14,GetDate()) )
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com ,sys.Client from sms_r_system as sys inner join SMS_ClientAdvertisementStatus as offer on sys.ResourceID=offer.ResourceID WHERE AdvertisementID = A0120005 and LastStateName = Failed Notice for both collections you need to find the unique advertisement ID
Note:-Collection ID CEN000394 systems not in will show here.. you can play with limit collection membership if you want..here...more useful
www.Paddymaddy.com
,SMS_R_SYSTEM.ResourceDomainORWorkgroup ,SMS_R_SYSTEM.Client FROM SMS_R_System WHERE Name IN (Select ServerName FROM SMS_DistributionPointInfo WHERE IsPeerDP = "1")
www.Paddymaddy.com
17. Systems are in A collection But not in B Collection & Vice versa
select * from SMS_R_System where SMS_R_System.Name not in (select name from SMS_CM_RES_COLL_CEN00394) and SMS_R_System.Name in (select name from SMS_CM_RES_COLL_CEN00395)
www.Paddymaddy.com
Note:-The systems not in Colelction ID CEN000394 and systems in collection ID CEN00395 will show
here ...again you can play with limit collection membership if you want..here...more usefull
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com WHERE (UCS.Status IN ('2')) AND (dbo.v_Collection.CollectionID = 'HCC000FB') ORDER BY UI.ArticleID
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com SMS_G_System_OPERATING_SYSTEM.Caption like "%windows 7%") and (DateDiff(day, SMS_G_System_OPERATING_SYSTEM.LastBootUpTime, GetDate()) >7)
25. All Clients without a Config Mgr. Agent installed(All Non Client Systems collection)
select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMS UniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Client is null or=0
Note: You can write in this way also.. Just change the version you want to put
select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System where SMS_R_System.ClientVersion != "4.00.6221.1000"
www.Paddymaddy.com
www.Paddymaddy.com
select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from sms_r_system AS sms_r_system join SMS_StatMsg as st on sms_r_system.Name = st.MachineName join SMS_AdvertisementStatusInformation sti on st.MessageID = sti.MessageID where sti.messagestate = 102
www.Paddymaddy.com
102 is the reboot pending code You can get the complete list of codes using the following sql query select distinct messagestate,MessageStateName from dbo.v_AdvertisementStatusInformation
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com SELECT v_R_System.Name0, v_Collection.Name FROM v_FullCollectionMembership INNER JOIN v_R_System ON v_FullCollectionMembership.ResourceID = v_R_System.ResourceID INNER JOIN v_Collection ON v_FullCollectionMembership.CollectionID = v_Collection.CollectionID WHERE (v_R_System.Name0 = 'Systemname')
36. All Required Patches in a specific collection systems SQL SELECT DISTINCT
Document created by Paddymaddy www.Paddymaddy.com Version 1.0 Email me : paddy@paddymaddy.com TOP (100) PERCENT SYS.Name0 AS [Machine Name], UCS.Status AS [Patch Status Code], CASE WHEN UCS.Status = '2' THEN 'Applicable' WHEN UCS.Status = '3' THEN 'Installed' ELSE '' END AS 'Patch Status', UI.BulletinID, UI.ArticleID, UI.Title, dbo.v_FullCollectionMembership.ResourceID, dbo.v_Collection.CollectionID FROM dbo.v_FullCollectionMembership INNER JOIN dbo.v_Collection ON dbo.v_FullCollectionMembership.CollectionID = dbo.v_Collection.CollectionID INNER JOIN dbo.v_R_System AS SYS LEFT OUTER JOIN dbo.v_Update_ComplianceStatusAll AS UCS ON SYS.ResourceID = UCS.ResourceID INNER JOIN dbo.v_UpdateInfo AS UI ON UCS.CI_ID = UI.CI_ID ON dbo.v_FullCollectionMembership.ResourceID = UCS.ResourceID WHERE (UCS.Status IN ('3', '2')) AND (dbo.v_Collection.CollectionID = 'CollectionID') ORDER BY UI.ArticleID
37. How to find all Collections WQL Query and collection ID and Names in the SQL ? (SQL not the WQL)
SELECT TOP (100) PERCENT dbo.v_Collection.Name, dbo.v_Collection.CollectionID, dbo.v_CollectionRuleQuery.RuleName, dbo.v_CollectionRuleQuery.QueryID, dbo.v_CollectionRuleQuery.LimitToCollectionID, dbo.v_CollectionRuleQuery.QueryExpression FROM dbo.v_Collection INNER JOIN
38. how to find all collection ID's from SQL ? (SQL not WQL)
SELECT FROM Name, CollectionID dbo.v_Collection