I ran into a problem whereby I wanted to force inventory updates on a whole lab of computers at once (about 27 machines), however in the K1000 I could only update them one at a time, causing me to spend a lot of time doing this.

I came up with the following solution:

First I installed the pstools suite from Microsoft, the one I particularly wanted was psexec.

I then wrote the following Python Script to do the inventory updates:


## import necessary modules
import thread
import os
import sys

## Set locations to runkbot.exe and kdeploy.exe

runkbot = r'"C:\Program Files\Dell\KACE\runkbot.exe"'
kdeploy = r'"C:\Program Files\Dell\KACE\KDeploy.exe"'

## Define function to process the Inventory Update for individual machines and

##deploy any waiting managed installs

def InvUpdate(id):
os.system('psexec.exe \\\\%s ' %id + runkbot + ' -s 4 0')
os.system('psexec.exe \\\\%s ' %id + kdeploy + ' -mi')

## create a list of machines you want to force an inventory update on
class = ['machine1', 'machine2', 'machine3']


## Forces inventory update by creating multiple threads for machines in the 'class' group
for machines in class:
   thread.start_new_thread(InvUpdate, (machines,))

This goes off and runs "C:\Program Files\Dell\KACE\runkbot.exe -s 4 0" on all machines listed under "class"

The script is pretty quick and rough, but it does the job.

Let me know what you think, and feel free to give it a go and see if it works for you



Christian Dow

System Administrator

Wanganui Park Secondary College