Is there any SQL query that can fetch last 2 years workstation in sccm without using collection id

Question

Is there any SQL query that can fetch last 2 years workstation in sccm without using collection id

solved 0
Saurabh Sharma 1 month 2021-01-26T15:51:43+05:30 1 Answer 17 views Beginner 0

Answer ( 1 )

  1. If you have a query with a collection ID then it’s easy to produce a one without collection ID?

    I don’t have this type of query ready now

    But you can start learning from this query

    SELECT SYS.Netbios_Name0 as ‘Computer Name’,
    SIS.SMS_Installed_Sites0 as ‘SMS Site’, WS.LastHWScan,
    DATEDIFF(day,WS.LastHWScan,GETDATE()) as ‘Days Since HWScan’
    FROM v_GS_WORKSTATION_STATUS WS INNER JOIN v_R_System SYS
    ON WS.ResourceID = SYS.ResourceID INNER JOIN v_RA_System_SMSInstalledSites SIS
    ON WS.ResourceID = SIS.ResourceID
    WHERE SYS.Client_Type0 = 1 AND SYS.Active0 = 1 AND
    WS.LastHWScan < DATEADD([day],-2,GETDATE()) Taken from https://docs.microsoft.com/en-us/mem/configmgr/develop/core/understand/sqlviews/sample-queries-hardware-inventory-configuration-manager

    Best answer

Leave an answer

Sorry, you do not have a permission to answer to this question .