/build/static/layout/Breadcrumb_cap_w.png

Custom Inventory Rule or SQL report to show what machines KACE scripts failed or ran successfully on?

Hi! I'm using two online K-scripts to push out two registry edits and am wondering if there's a way for me to see what machines have it installed. I've created two Software entries for each registry edit and added a custom inventory rule, but no machines are listed (even though I have them installed on several machines). Do those only apply to things installed via managed installs and self-services? Preferably I'd like to see both registry edits listed under Installed Programs for each machine, but I'm not sure how to get that to work or if that's possible.


Just in case that's not possible I've created a SQL report, but I'm not fluent in SQL so it didn't turn out how I wanted it. Would someone be able to help me tweak the report to show what machines have it installed? I like the current layout, but it doesn't tell me the specific machines that the scripts failed/succeeded on.

Software entry #1: QFE_Boston -> Custom Inventory Rule: RegistryKeyExists(HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\Options\QFE_Boston)

Software entry #2: UsePrinterDCForMetafile -> Custom Inventory Rule: RegistryKeyExists(HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\UsePrinterDCForMetafile)

SQL for my report:

select DATE_FORMAT(r.START_TIME,'%b %d %Y %I:%i:%s %p') as 'Start Time',
                       k.NAME as 'Script Name',
                       CONCAT(sum(if(m.REQUEST_TIME is not null, 1, 0)),'/',count(m.MACHINE_ID)) as Pushed,
                       CONCAT((sum(if(m.REQUEST_TIME is not null
                       and REQUEST_STATUS is not null and REQUEST_STATUS not like '200%', 0,
                       if(k.SCHEDULE_TYPE like '%kscript%', if(m.KBOT_LOG_ID is not null, 1, 0),
                       if(length(l.STATUS), 1, 0))))),'/',((sum(if(m.REQUEST_TIME is not null, 1, 0)))-(
                        sum(if(m.REQUEST_TIME is not null and REQUEST_STATUS is not null and REQUEST_STATUS not like
                            '200%', 1, 0))) )) as Completed,
                       sum(if(l.STATUS in (1,2), 1, 0)) as Success,
                       sum(if(REQUEST_STATUS is null, 1, 0)) as Running,
                       ((sum(if(l.STATUS not in(1,2), 1, 0)))) as Failure  from KBOT_RUN r
             left join KBOT_RUN_MACHINE m
                    on m.KBOT_RUN_ID = r.ID
             left join KBOT k
                    on r.KBOT_ID = k.ID
             left join KBOT_LOG l
                    on m.KBOT_LOG_ID = l.id
              group by r.ID  order by r.START_TIME DESC


Thanks in advance!


0 Comments   [ + ] Show comments

Answers (2)

Posted by: chucksteel 7 years ago
Red Belt
1
The KInventory process runs under the SYSTEM account, so keys in HKEY_CURRENT_USER won't be detected properly. 

Comments:
Posted by: jfmav 7 years ago
Senior White Belt
0

have you checked the Os Systems in the Software entry ??


Comments:
  • Do you mean if I have my OS(s) selected under Supporting Operating Systems? If so, then yes. - ithelpdeskacc 7 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ