I need some help with a Microsoft Deployment Toolkit (MDT) project I’m working on. So, I'm attempting to set the ComputerName on newly imaged machines using a concatenation of the custom variable/property (ComputerType) and a string manipulation of the built-in SerialNumber variable. Unfortunately, this is failing for me as my custom variable isn't being expanded/evaluated during the task sequence. Instead of seeing the value, I'm seeing the name of the variable itself displayed as "%ComputerType%". The same is true when looking at the BDD.log file.
Below is what I have in my CustomSettings.ini file (set via the Rules section of the MDT Workbench). This behavior is confirmed when I look at the Monitoring section of the MDT Workbench, where I see "Prefix-%ComputerType%-000b5" listed as the "Name" of the computer being imaged, instead of something like "Prefix-VM-000b5". This ends up creating a computer name that exceeds the 15-character limitation of Windows, as such, my task sequence fails when it goes to change the computer name during the post install phase.
What am I doing wrong?
Here's what my CustomSettings.ini file looks like:
[Settings] Priority=IsVM,IsLaptop,IsDesktop,IsServer,SetComputerName,Default Properties=ComputerType,MyCustomProperty [IsVM] Subsection=Virtual-%IsVM% [IsLaptop] Subsection=Laptop-%IsLaptop% [IsDesktop] Subsection=Desktop-%IsDesktop% [IsServer] Subsection=Server-%IsServer% [Virtual-True] ComputerType= [Laptop-True] ComputerType=LT [Desktop-True] ComputerType=WS [Server-True] ComputerType=SV [SetComputerName] OSDComputerName=Prefix-%ComputerType%-#Right(Replace(Replace(oEnvironment.Item("SerialNumber")," ",""),"-",""),5)# [Default] _SMSTSORGNAME=OS Deployment on %OSDComputerName% FullName=Assigned User's Name OrgName=My Company Name Home_Page=https://mail.exchangeserver.com User_Locale=en-us KeyboardLocale=en-us UserDataLocation=NONE DoCapture=YES OSInstall=Y AdminPassword=MyPassword TimeZone=035 TimeZoneName=Eastern Standard Time JoinWorkgroup=WORKGROUP HideShell=YES FinishAction=SHUTDOWN DoNotCreateExtraPartition=YES AppyGPOPack=NO SkipAdminPassword=YES SkipProductKey=YES SkipComputerName=YES SkipDomainMembership=YES SkipUserData=YES SkipLocaleSelection=YES SkipTaskSequence=NO SkipTimeZone=YES SkipApplications=YES SkipBitLocker=YES SkipSummary=YES SkipRoles=YES SkipCapture=NO SkipFinalSummary=NO SkipComputerBackup=YES EventService=http://mdtserver ;LOGGING SLShare=\\mdtserver\DeploymentShare$\Logs SLShareDynamicLogging=\\mdtserver\DeploymentShare$\Logs\%ComputerName%