[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!
Source - KBScriptRunner.au3
Compiled - KBScriptRunner.exe
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)
Please log in to answer
Posted by:
RichB
12 years ago
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?
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
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.
so that the conversation will remain readable.