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
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Is there any SQL query that can fetch last 2 years workstation in sccm without using collection id
Answer ( 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