/build/static/layout/Breadcrumb_cap_w.png

[blog] Custom KBScriptRunner for 5.3

I've written an AutoIT script to force an inventory check-in (runkbot 4 0) and FS/MI processing (runkbot 6 0). The program outputs console text to custom logs (kbs_inventory.log and kbs_mi.log) in the install directory. I've added a splash screen as well, so you can tell what the script is doing (don't have to guess when it's done or look at processes).

Simply place the compiled EXE from my source code (both attached) in the Dell KACE Agent install directory, and run it under an account with local administrator rights (use RunAs if you're trying to run it under a restricted user account).

Enjoy!


#NoTrayIcon
;========================================================
; AutoIt version of Dell KACE KBScriptRunner.exe
;
; Written by: Andy Flesner - Systems Architect
; Original: February 20, 2012
; Last Updated: February 20, 2012
;========================================================
#Include <File.au3>

Global $programfiles = "C:\Program Files", $errlog = $programfiles & "\Dell\KACE\KBScriptRunner_error.log"

; Determine architecture
If @OSArch = "X64" Then
$programfiles = "C:\Program Files (x86)"
EndIf

; Force Dell KACE Agent Inventory
SplashTextOn("KBScriptRunner","Forcing Dell KACE Agent Inventory...",400,50)
RunWait(@ComSpec & ' /c "' & $programfiles & '\Dell\KACE\runkbot.exe" 4 0 > kbs_inventory.log',$programfiles & "\Dell\KACE",@SW_HIDE)
SplashTextOn("KBScriptRunner","Forcing Dell KACE Agent FS/MI Processing...",400,50)
RunWait(@ComSpec & ' /c "' & $programfiles & '\Dell\KACE\runkbot.exe" 6 0 > kbs_mi.log',$programfiles & "\Dell\KACE",@SW_HIDE)
SplashTextOn("KBScriptRunner","KBScriptRunner complete.",400,50)
Sleep(5000)
SplashOff()


Source - KBScriptRunner.au3
Compiled - KBScriptRunner.exe

0 Comments   [ + ] Show comments

Answers (2)

Posted by: RichB 12 years ago
Second Degree Brown Belt
0
This is awesome Andy! I miss the original kbscriptrunner.exe so hope something like this will be included automatically with new clients. I love the clean splash screen feedback dialog as opposed to the ugly command window too. Good to know the logs contain all that detail if desired.

I am curious as to whether you tried them in reverse order so managed installs would happen first and then the inventory would reflect the changes?
Posted by: airwolf 12 years ago
Red Belt
0
Well, if I reverse the order, then the agent will only have an MI list from the last check-in... so you're either stuck with old MIs then the check-in or check-in then new MIs but they won't show up in inventory until the subsequent check-in. I suppose the best solution would be to run 4 then 6 then 4 again. That's an easy modification.

#NoTrayIcon
;========================================================
; AutoIt version of Dell KACE KBScriptRunner.exe
;
; Written by: Andy Flesner - Systems Architect
; Original: February 20, 2012
; Last Updated: February 21, 2012
;========================================================
#Include <File.au3>

Global $programfiles = "C:\Program Files", $errlog = $programfiles & "\Dell\KACE\KBScriptRunner_error.log"

; Determine architecture
If @OSArch = "X64" Then
$programfiles = "C:\Program Files (x86)"
EndIf

; Force Dell KACE Agent Inventory
SplashTextOn("KBScriptRunner","Forcing Dell KACE Agent Inventory (1)...",400,50)
RunWait(@ComSpec & ' /c "' & $programfiles & '\Dell\KACE\runkbot.exe" 4 0 > kbs_inventory1.log',$programfiles & "\Dell\KACE",@SW_HIDE)
SplashTextOn("KBScriptRunner","Forcing Dell KACE Agent FS/MI Processing...",400,50)
RunWait(@ComSpec & ' /c "' & $programfiles & '\Dell\KACE\runkbot.exe" 6 0 > kbs_mi.log',$programfiles & "\Dell\KACE",@SW_HIDE)
SplashTextOn("KBScriptRunner","Forcing Dell KACE Agent Inventory (2)...",400,50)
RunWait(@ComSpec & ' /c "' & $programfiles & '\Dell\KACE\runkbot.exe" 4 0 > kbs_inventory2.log',$programfiles & "\Dell\KACE",@SW_HIDE)
SplashTextOn("KBScriptRunner","KBScriptRunner complete.",400,50)
Sleep(5000)
SplashOff()
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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