You will need to parse out the $DestDir as you were doing in your first example. Then check for each directory as you move down the path.

Ex:

cn=myuser,ou=office,cn=hq,dn=fabrikom,dn=microsoft,dn=com

 Code:
$ar_DN = Split($DestDir,",")
For each $element in $ar_DN
  $dir = $dir + "\" + Split($Element,"=")[1]
  If Not Exist $Dir  
    mkdir($dir)
  EndIf
Next
_________________________
Today is the tomorrow you worried about yesterday.