Long UNC File Paths and MDT Replication

I had some trouble recently with replication of content in my LiteTouch distribution shares. Apparently the sync mechanism being used by the Deployment workbench is sensitive to path length. If you have an application that has a full share path that is greater than 260 characters, replication will fail. (Come to think of it, this is a CIFS limitation, isn’t it?)

To cure this, we needed to hunt down the offending files. Real UNIX guys likely would find this easy. I had to muck about with Powershell a bit to get something that was helpful:

gci "\sysimg3.campus.ad.uvm.edudeployapplicationsArcGIS" -recurse `
   | foreach {$_.PSPath.Split(":")}  `
   | ? {$_.length -gt 251}

So, we are using “gci” (get-childitem) to recurse all contents of the offending parent directory, then using “foreach-item” to runa check on every child. We use “PSPath.Split” to split the path into UNC and PS Drive Provider components. We then use “?” (short for where-object) to select only strings where the path is longer than a specified length… say, 250, to allow some padding identification of potentially problematic temp files used during workbench replication.

Advertisements