Report 显示上次使用软件时间的Sccm报告

Report 显示上次使用软件时间的Sccm报告,report,sccm,Report,Sccm,我正在创建一个报告来查找我们网络上有特定软件的计算机 在我想知道该程序最后一次使用的时间之前,该报告一直运行良好。当我添加“LastUsedTime0”时,结果增加了 我不是一个程序员,我的脚本是许多脚本的试错,但看起来数据库的链接不正确(根据我的crystal reports经验) 这是剧本 ============================= SELECT s.Name0, DisplayName0, Publisher0, s.AD_Site_Name0, TopConsoleUse

我正在创建一个报告来查找我们网络上有特定软件的计算机

在我想知道该程序最后一次使用的时间之前,该报告一直运行良好。当我添加“LastUsedTime0”时,结果增加了

我不是一个程序员,我的脚本是许多脚本的试错,但看起来数据库的链接不正确(根据我的crystal reports经验)

这是剧本

=============================

SELECT s.Name0, DisplayName0, Publisher0, s.AD_Site_Name0, TopConsoleUser0, LastUsedTime0

FROM v_Add_Remove_Programs arp,V_R_system s, 
v_FullCollectionMembership fcm, 
v_GS_CCM_RECENTLY_USED_APPS rua,
v_GS_SYSTEM_CONSOLE_USAGE scu

WHERE fcm.CollectionID = 'SMS00001' and 
arp.ResourceID=fcm.ResourceID and 
arp.ResourceID=s.ResourceID and 
arp.ResourceID=rua.ResourceID and
arp.ResourceID=scu.ResourceID and


(
DisplayName0 like 'Microsoft Office%' and
DisplayName0 not like '%Excel%' and
DisplayName0 not like '%database engine%' and
DisplayName0 not like '%slide%' and
DisplayName0 not like '%frontpage%' and
DisplayName0 not like '%SharePoint%' and
DisplayName0 not like '%Live%' and
DisplayName0 not like '%PowerPoint%' and
DisplayName0 not like '%Word%' and
DisplayName0 not like '%XML%' and
DisplayName0 not like '%Communicator%' and
DisplayName0 not like '%SR-1%' and
DisplayName0 not like '%Resource%' and
DisplayName0 not like '%Visio%' and
DisplayName0 not like '%Web%' and
DisplayName0 not like '%XP%' and
DisplayName0 not like '%Sounds%' and
DisplayName0 not like '%OneNote%' and
DisplayName0 not like '%Click%' and
DisplayName0 not like '%Primary%' and
DisplayName0 not like '%Standard%' and
DisplayName0 not like '%Connector%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%Add-in%' and
DisplayName0 not like '%Validation%' and
DisplayName0 not like '%Components%' and
DisplayName0 not like '%Proof%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Project%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Access%' and
DisplayName0 not like '%engine%' and
DisplayName0 not like '%Runtime%' and
DisplayName0 not like '%Standard%' and
DisplayName0 not like '%Connector%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%Add-in%' and
DisplayName0 not like '%Validation%' and
DisplayName0 not like '%Components%' and
DisplayName0 not like '%Proof%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Project%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Trial%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Access%' and
DisplayName0 not like '%engine%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Visio%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Viewer%' and
DisplayName0 not like '%Service%' 
)

GROUP BY DisplayName0, Publisher0, s.AD_Site_Name0, s.Name0, LastUsedTime0, TopConsoleUser0

ORDER BY Publisher0
===========================

SELECT s.Name0, DisplayName0, Publisher0, s.AD_Site_Name0, TopConsoleUser0, LastUsedTime0

FROM v_Add_Remove_Programs arp,V_R_system s, 
v_FullCollectionMembership fcm, 
v_GS_CCM_RECENTLY_USED_APPS rua,
v_GS_SYSTEM_CONSOLE_USAGE scu

WHERE fcm.CollectionID = 'SMS00001' and 
arp.ResourceID=fcm.ResourceID and 
arp.ResourceID=s.ResourceID and 
arp.ResourceID=rua.ResourceID and
arp.ResourceID=scu.ResourceID and


(
DisplayName0 like 'Microsoft Office%' and
DisplayName0 not like '%Excel%' and
DisplayName0 not like '%database engine%' and
DisplayName0 not like '%slide%' and
DisplayName0 not like '%frontpage%' and
DisplayName0 not like '%SharePoint%' and
DisplayName0 not like '%Live%' and
DisplayName0 not like '%PowerPoint%' and
DisplayName0 not like '%Word%' and
DisplayName0 not like '%XML%' and
DisplayName0 not like '%Communicator%' and
DisplayName0 not like '%SR-1%' and
DisplayName0 not like '%Resource%' and
DisplayName0 not like '%Visio%' and
DisplayName0 not like '%Web%' and
DisplayName0 not like '%XP%' and
DisplayName0 not like '%Sounds%' and
DisplayName0 not like '%OneNote%' and
DisplayName0 not like '%Click%' and
DisplayName0 not like '%Primary%' and
DisplayName0 not like '%Standard%' and
DisplayName0 not like '%Connector%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%Add-in%' and
DisplayName0 not like '%Validation%' and
DisplayName0 not like '%Components%' and
DisplayName0 not like '%Proof%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Project%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Access%' and
DisplayName0 not like '%engine%' and
DisplayName0 not like '%Runtime%' and
DisplayName0 not like '%Standard%' and
DisplayName0 not like '%Connector%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%Add-in%' and
DisplayName0 not like '%Validation%' and
DisplayName0 not like '%Components%' and
DisplayName0 not like '%Proof%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Project%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Trial%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Access%' and
DisplayName0 not like '%engine%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Service%' or
DisplayName0 like 'Microsoft Visio%' and
DisplayName0 not like '%Pack%' and
DisplayName0 not like '%MUI%' and
DisplayName0 not like '%Viewer%' and
DisplayName0 not like '%Service%' 
)

GROUP BY DisplayName0, Publisher0, s.AD_Site_Name0, s.Name0, LastUsedTime0, TopConsoleUser0

ORDER BY Publisher0
这个脚本可能甚至不是我想要做的事情的最佳方式,所以任何建议都是很好的


感谢您的时间。

您正在进行的连接在技术上是可行的,但会给您错误的结果。这是一对多的关系,这就是为什么你会看到“重复”

添加/删除程序数据与执行数据无关。它与机器相关,而机器又与执行数据相关。但两者之间没有直接关系

添加/删除程序数据是安装程序时(通常)写入Windows注册表的数据。执行数据由SCCM客户端的软件计量部分收集。它监视.exe文件的执行。.exe文件不一定是“添加/删除程序”中的程序,并且“添加/删除程序”中的程序可能有多个与其相关的可执行文件。这就是查询返回错误结果的原因

您最好从最近使用的v_GS_CCM_应用程序获取所有数据,并从查询中删除添加/删除程序。v_GS_CCM_最近使用的_应用程序中有一个产品名称列,其中有执行数据