Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

DS7 - Flawed Token Replacement

Created: 26 Nov 2012 • Updated: 26 Nov 2012 | 2 comments

I was trying to build our own custom token to update our customized unattend files for server builds. We have multiple domains where servers are built but wanted sysprep to handle joining the computer to the domain. I figured I could create our own JOIN Token similar to how the deployment task does it. However the are some major flaws to how DS7 tokens work that caused many headaches.

 

  1. First you can't use LIKE in a CASE statement  or anyplace else as the % character automatically makes the token tool think anything between % and the next % will be another token. For instance: CASE WHEN FQDN LIKE '%.DomainA.COM' Then 'DomainA' WHEN FQDN LIKE '%.DomainB.COM' Then 'DomainB'. In this case the Token function will think this is a token to replace: ''%.DomainA.COM' Then 'DomainA' WHEN FQDN LIKE '%' and fail.
  2. Next is the use of + and !. If these exist the token will first save but then strip out these characters causing errors in scripts or strings that might use them.
  3. A huge PITA factor is that the token SQL has to be all on the same line. This is fine if it's a simple query however, more advance queries become very hard to manage as you can't just copy a cleanly formatted SQL query in as a token.
  4. Finally once you can get everything working output will replace < and > characters with &lt; and &gt; So '<Identification>' will end up looking like &lt;Identification&gt;. Defeating the hole endeavor.

Comments 2 CommentsJump to latest comment

mclemson's picture

Have you tried downloading the DS 7.1 Samples from support.symantec.com and then using the enclosed token replacement script for parsing your sysprep file?

Mike Clemson, Senior Systems Engineer, ASC
Intuitive Technology Group -- Symantec Platinum Partner
intuitivetech.com

noodleNT's picture

Yes... that's how we do our token replacements in our unattend files. The main issue is how the Token gets outputted when called by the token replacement script. I find it odd that all these issues do not exist when writing a report or filter. The whole tool in my eyes needs to be re-engineered to be truly useful.