K1000 - File Synchronization - Tips, Tricks and Things I Have Learned

First off, sorry it's been a while - been busy here at KACE!      ^_^

And now that I'm an employee, I *really* need to stress that everything below is based on my own research and findings - the information below does not indicate official documentation or support, however some of this may be accurate.

Well, it seems there were always more pressing items and no projects calling for the K1000's File Synchronization feature when I was a customer, but the opportunity arose to ramp up on it a bit here while reviewing some training material. And since I didn't see any blogs on this topic, I thought this might be useful to anyone looking to use the feature - which is pretty slick but not necessarily the solution for *every* file distribution scenario.

In a nutshell, file synchronization strikes me as basically being a managed installation, just without the execution part. It is scheduled to run at the agent run interval, which is typically the inventory interval. With that being said, the best use cases I can see are as follows:

  • files need to be copied to machines running the K1000 agent
  • these same files need updated, but no more often than the K1000 agent update interval

So, making sure all users have certain IE Favorites, Desktop shortcuts and local documentation files would all be good candidates.

Another common usage scenario is to pre-cache files for a script to execute at a specified time - in other words, a Managed Installation-like distribution with a finely controlled installation time.

For distribution needs outside of these areas, it's probably best to look into Scripts (which can be scheduled on a tighter interval) and/or Managed Installations to copy/execute files (when the timing of the distribution doesn't need finely controlled).

Anyways, I'll cover a basic working config and then some things I discovered in my own testing. As always, hope this helps! ^_^


Basic File Synchronization Config

  • tested using K1 5.4 SP1


1) Create a custom Software item.

  • Inventory > Software > Choose Action > Add New Item
    • Doesn't always have to be custom, however it usually is

2) Configure the custom Software item

  • Display Name (Title):                        *FS - SyncTest
    • I suggest prefixing file syncs with "*FS - ", so they will be at the top of the Software list
  • Supported Operating Systems:      specify the target machines' OSes
  • Upload & Associate File:                 Choose File and select your file (or ZIP file, if multiple files)
    • The ZIP file can contain multiple folders, subfolders and files
    • Just be aware that it will be unzipped to the specified Location folder, unless you use the Do Not Uncompress Distribution file sync option
  • Any other settings you feel are appropriate (i.e. version info, labels, etc)
    • Version info is recommended, for example using dates for the version numbers

3) Create a File Synchronization item

  • Distribution > File Synchronization > Choose Action > Add New Item

4) Configure the File Synchronization item

  • Software Title to Install:                         select the Software item you just configured
  • Location (full directory path):                C:\Folder You Want To Sync Folders and Files To\Subfolders
    • don't use quotes if there are spaces in the pathname (the agent will automatically do this)
  • Location User:                                         leave blank, unless you are using Replication Shares (Test 1 below)
  • Location Password:                               leave blank, unless you are using Replication Shares (Test 1 below)
  • Enabled <checked>
    • specifies whether the file sync item will run or not
  • Create Location (if d...):                          <checked>
    • use this if you want to *create* a target folder that doesn't exist, like C:\KACE\Syncs
    • works with UAC enabled and in Windows 7 protected folders (C:\Program Files, C:\Windows, etc)
  • Persistent:                                                <checked>
    • determines whether the package is already present or not before deploying
    • this option will also replace a the Location folder if it is deleted
    • if the Location folder name changes, make sure this option is enabled or the file sync will stop working
    • changes to the name of the uploaded file do not require this option to be enabled for the file sync to continue working
  • Create Shortcut (to location):                <checked>
    • creates a shortcut in C:\Users\Public\Desktop to the folder specified in the Create Location field
    • the Shortcut Name option allows the shortcut to be named anything (no limited to folder name)
  • Delete Temp Files:                                <checked>
    • this removes the file (ZIP or otherwise) that gets pushed to the client machine(s), from which the files are extracted
    • this is the same file that is uploaded in the Software item page
    • it can be useful to leave this option unchecked when troubleshooting, to make sure the file is being copied down to the target machine properly
    • the file download location is C:\ProgramData\Dell\KACE\downloads\####
      • #### = the Software item's Software.ID, which can be determined by mousing over the Software item's link
  • Deploy to All Machines:                         <not checked>
    • use with caution, better to do a gradual rollout via labels
  • Limit Deployment To Labels:               <none>
    • best approach to larger deployments
  • Limit Deployment To Listed M..:           Targeted machines
    • most convenient for one-off machine testing to verify file sync is working
  • Pre-Deploy User Message:                   customize as needed to fit your environment
    • leaving this field blank will suppress the File Sync message box
  • Post-Deploy User Message:                 customize as needed to fit your environment
    • leaving this field blank will suppress the File Sync message box 
  • Deployment Windows (24H clock):       default
    • runs from 0 (midnight) to 24 (midnight), in other words 24 hours a day
    • to restrict further (say 9AM - 5PM), adjust accordingly (say Open = 5, Closed = 17)
    • the time specified is server time, not agent (machine) time
  • Use Alternate Download:                          <unchecked>
    • can specify a UNC path to a file location
    • details in the K1000 Administration Guide (search on Using File Synchronizations)
  • Save 
  • Save and Resend Files is used to distribute previously deployed files after a deployment window has closed

5) Force an Inventory run on a targeted machine

  • Inventory > Computers > select target machine > Force Update button
    • K1000 agent processes can be monitored via Windows Task Manager
      • KLaunch initializes the agent processes
      • KInventory runs the Inventory process
      • KCopy uploads the resulting Inventory file
      • KLaunch initializes the File Synchronization process
      • KUserAlert brings up the File Sync User Messages screen
      • KDeploy copies the specified file and extracts it (if necessary) to the specified location
    • Note that a command can be use to just launch Managed Installs and File Synchronization processes on the target machine (locally or via K1000 Scripts)
      • x86 - C:\Program Files\Dell\KACE\runkbot.exe 6 0
      • x64 - C:\Program Files (x86)\Dell\KACE\runkbot.exe 6 0

6) Checking status from the K1000

  • back on the File Synchronization item's detail page, scroll to the bottom Software-To-Computer Deployment Detail section for a summary of systems which have run the synchronization task
  • a custom inventory rule (such as FileExists or FileVersionEquals) can also be a time saver here


File Synchronization Tests

  • The following are tests that I ran to determine how certain settings behaved and to clarify points.


Test 1 - File Syncs with and without a Replication Server

If a Replication Server is specified and configured *without* the failover to the K1000 option enabled:

1) The file needs to be enabled for replication in the Software Inventory : Detail Item screen
2) The file needs to be present on the replication share

If either of these are not done, an error similar to the one below will appear in kdeploy.log:

  • failed file sync attempt

[Thu May 30 17:11:53 2013] [CDeployController::ExecuteCustomInventoryRule] statement result: "", FALSE
[Thu May 30 17:12:47 2013] Error (win) copying files from
'smb://domain;username:xxxxxxxxx@server/share/repl2/software/1802/syncfile.zip.eee621363437148ae3412939e0acb44b' to
'C:\ProgramData\Dell\KACE\downloads\1802\syncfile.zip' : (2) The system cannot find the file specified.

This is in contrast to a successful kdeploy.log entry:

  • successful file sync

[Thu May 30 17:20:15 2013] [CDeployController::ExecuteCustomInventoryRule] statement result: "", FALSE


Test 2 - File Replacement without the Persistent Option Enabled

Deleted a file from the file sync target folder and re-ran file sync *without* the Persistent option enabled

Result - File sync didn't replace the deleted file

Note: The Persistent option needs to be enabled to replace deleted files

Test 3 - File Sync to a Location with Spaces in the Path Name

When syncing to an existing location (or a location created by the file sync) with a space in the path name, the Location (full directory path) needs to be listed as:

C:\Folder Name

Result - No quotes are necessary to compensate for spaces

Note: Putting quotes around target pathname will cause the file sync to fail

Test 4 - Sync zip file contains subfolders and files with spaces in names

Result - No issues creating or syncing folders/files with spaces in name

Test 5 - Making changes to same file to determine if file sync updates existing files

Tested with a text file

  • completed initial file sync push
  • made changes to text file, re-zipped & re-uploaded to Inventory-Software item
  • re-inventoried machine to trigger file sync

Result - Updated file with changes replaced previous version of file

Test 6 - Changing file sync target location to see if Desktop shortcut is updated

Result - Yes, Desktop shortcut is updated to reflect the new location appropriately

Test 7 - Syncing to Windows 7 protected folders

UAC Disabled - tested file syncing to:

  • C:\Program Files
    • worked fine
  • C:\Users\Public\Public Desktop
    • created new Public Desktop folder under C:\Users\Public
    • need to be C:\Users\Public\Desktop
  • C:\Users\Public\Desktop
    • worked, but had to right-click on Desktop and select Refresh to get the folder to appear
    • pressing F5 did not work (could just be a VM issue)
    • the Desktop shortcut appeared without any issues
  • C:\Windows\System32
    • worked fine

UAC Enabled (highest setting) - tested file syncing to:

  • C:\Program Files
    • worked fine
  • C:\Users\Public\Desktop
    • worked, but had to right-click on Desktop and select Refresh to get the folder to appear
    • pressing F5 did not work (could just be a VM issue)
    • the Desktop shortcut appeared without any issues
  • C:\Windows\System32
    • worked fine