Recently, I was working on creating a File Synchronization job with KACE. This was in fact the first time I attempt to use this function, which ended proving to be quite useful.
However, that’s not the main purpose of my post. Throughout my experimentation to get the File Sync to work, I found out that I need to have a Software Inventory item for the file sync.
In my case that file sync was just a simple shortcut placed on the user’s desktop. You may be asking why I didn’t do an alternate and simpler method to accomplish the same. (i.e with a login script, or even a simple xcopy, etc…)
The different between doing that, and using the KACE File Sync, is that the latter will allow me to target a machine label, and enable the rule, and therefore, not have to worry about having to run the script again. KACE will monitor and track all of that for me.
That being said, the problem regarding the custom inventory came into play when I was creating the Software title. The shortcut was simply called: “UMRA Forms.lnk”. I wanted to place it on all workstations, Windows XP or Windows 7. Since the paths to the “All Users” desktop is different on the 2 OSes, my first thought was to use the %ALLUSERSPROFILE% variable, and call it a day. Unfortunately, this didn’t work. So, I had to resort to checking for the absolute path of the file within the Software Inventory item, to determine whether the shortcut already exists. If I didn’t do that, then the job will run every time a client checks in.
For this to happen, I just create a Custom Inventory Rule that looks like this:
FileExists(C:\Users\Public\Desktop\UMRA Forms.lnk) OR FileExists(C:\Documents and Settings\All Users\Desktop\UMRA Forms.lnk)
At first glance, this looks like it would absolutely work. (As a side note, this is on a KBOX running version 5.3.53053). Since this behavior I’m describing here could potentially point to a bug, this article may be rendered obsolete at the next release of the K1000 software.
The above, will actually NOT work. It would if you remove the OR operand, and the value after it. So, what gives? my first thought was to put the string in quotes, but then, after researching the KACE forums, they explicitly mention that the single and double quotes are not allowed in the custom inventory rule.
Of course, the next step to troubleshoot this, was to enable debug on the client, to figure out what’s happening.
Enable Debug Mode
go to: C:\programdata\dell\kace\ (on windows 7)
C:\Documents and Settings\All Users\Application Data\Dell\Kace\ (on XP)
echo debug=true >> amp.conf
net stop ampagent && net start ampagent
After enabling debug on the client, and examining the kdeploy.log, here’s what I found:
[Thu Sep 20 14:10:11 2012] KDeploy Item 22445: Results=False Raw='' Data='' [Thu Sep 20 14:10:11 2012] KDeploy Process 5 Rule(s) for Item: 22981 [Thu Sep 20 14:10:11 2012] KDeploy - Rule True=FileExists(C:\Users\Public\Desktop\UMRA Forms.lnk) [Thu Sep 20 14:10:11 2012] KDeploy - Rule [OR] [Thu Sep 20 14:10:11 2012] KDeploy - Rule False=FileExists(C:\Documents [Thu Sep 20 14:10:11 2012] KDeploy - Rule [AND] [Thu Sep 20 14:10:11 2012] KDeploy - Rule False=Settings\All Users\Desktop\UMRA Forms.lnk)
Notice that the “AND” in “Documents and Settings” is being treated as a boolean operator. That was a bit surprising, as I would’ve suspected that the spaced would pose more of a problem than the word “and” inside the function parameters.
From this point on, it was actually pretty simple to fix the problem. All that was required was to replace this:
C:\Documents and Settings\All Users\Desktop\UMRA Forms.lnk
C:\Docume~1\All Users\Desktop\UMRA Forms.lnk
Now, if you run runkbot 4 0 to force inventory, the rule will evaluate correctly, and populate the software item with the machines that have the icon on the desktop.
I thought this was worth a post, because I personally spent quite a bit of time troubleshooting this, and ended up having to call KACE support before I ended up finding this solution myself.
Hope this helps someone out there.
UPDATE: Heard back from KACE regarding this issue, and it has been reported as a bug. This issue will be resolved in release 5.4 which is due to be out in the next couple of months.