Combing the local account number of the computer through SCCM-- SQL sentence carding
SQL statement query
Declare @ olddcm datetime
Declare @ oldhinv datetime
Set @ oldDCM=DATEADD (DAY,-3, getdate ())
Set @ oldHinv=DATEADD (DAY,-3, getdate ())
Select sys1.netbios_name0
, lgm.name0 [Name of the local Group]
, lgm.account0 as [Account Contained within the Group]
, lgm.category0 [Account Type]
, lgm.domain0 [Domain for Account]
, lgm.type0 [Type of Account]
, case when ws.lasthwscan < @ oldhinv then 'Last Hinv might be out of date'
When cs.lastcompliancemessagetime < @ olddcm then'CI evaluation might be out of date'
When ws.lasthwscan < cs.lastcompliancemessagetime then'CI evaluated since hinv, not necessarily unreliable'
Else 'Recent CI Eval, Hinv since CI Eval = Fairly Reliable'
End as [Reliability of Information], lgm.TimeStamp
From
V_gs_localgroupmembers0 lgm
Join v_gs_workstation_status ws on ws.resourceid=lgm.resourceid
Join v_r_system_valid sys1 on sys1.resourceid=lgm.resourceid
Left join v_CICurrentComplianceStatus cs on cs.resourceid=lgm.resourceid
Left join v_LocalizedCIProperties_SiteLoc loc on loc.ci_id=cs.ci_id
Where loc.displayname = 'local group members into WMI With logging' and Netbios_Name0 =' lw7cneczgwitzy1'
Order by sys1.netbios_name0, lgm.name0, lgm.account0