report - 用于显示软件上次使用时间的 SCCM 报告

标签 report sccm

我正在创建一份报告,以查找我们网络上装有某些软件的计算机。

该报告工作正常,直到我想知道该程序上次使用的时间。当我添加“LastUsedTime0”时,结果增加了。

我不是编码员,我的脚本是许多脚本的反复试验,但看起来数据库的链接不正确(根据我的 Crystal 报告经验)。

这是脚本

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

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_RECENTLY_USED_APPS 获取所有数据,并从查询中删除添加/删除程序。 v_GS_CCM_RECENTLY_USED_APPS 中有一个产品名称列,并且有执行数据。

关于report - 用于显示软件上次使用时间的 SCCM 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10924447/

相关文章:

java - 范围报告 4 - Java

java - 线程 "AWT-EventQueue-0"java.lang.NoClassDefFoundError : org/apache/commons/lang3/Validate 中出现异常

windows - 从通过 SCCM 部署的 Powershell 脚本中运行 SFC.EXE

batch-file - 将 .link 复制到 64 位 Windows 中更改快捷方式内容

powershell - 如何使用 PowerShell 查找集合成员信息

powershell - Powershell或cmd-如何在客户端上搜索文件并用网络共享上的其他文件替换?

software-distribution - 有没有办法在 SCCM 2012 中重新安装应用程序?

database - 以有意义的方式可视化出勤数据

crystal-reports - Crystal 报表SetDataSource上的Appcrash

c - 哪种语言有助于为有效的 C 程序创建报告