码迷,mamicode.com
首页 > 数据库 > 详细

通过SCCM 梳理计算机本地账号——SQL 语句梳理

时间:2018-11-06 17:44:03      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:from   work   mem   count   where   tco   nta   val   ios   

SQL 语句查询
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

通过SCCM 梳理计算机本地账号——SQL 语句梳理

标签:from   work   mem   count   where   tco   nta   val   ios   

原文地址:http://blog.51cto.com/unicom/2313514

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!