自定义 MDT 属性/变量在任务序列期间未得到评估

自定义 MDT 属性/变量在任务序列期间未得到评估

大家好,

我需要一些有关我正在开展的 Microsoft 部署工具包 (MDT) 项目的帮助。因此,我尝试使用自定义变量/属性 (计算机类型)以及内置的字符串操作序列号变量。不幸的是,这对我来说是失败的,因为我的自定义变量在任务序列期间没有被扩展/评估。我没有看到值,而是看到变量本身的名称显示为“%ComputerType%”。查看 BDD.log 文件时也是如此。

以下是我的 CustomSettings.ini 文件中的内容(通过 MDT Workbench 的规则部分设置)。当我查看 MDT Workbench 的监控部分时,我确认了此行为,其中我看到“前缀-%ComputerType%-000b5“被列为”姓名” 被映像的计算机,而不是像“前缀-VM-000b5“。这最终会创建一个超出 Windows 15 个字符限制的计算机名称,因此,当我在安装后阶段更改计算机名称时,我的任务序列会失败。

我究竟做错了什么?

以下是我的 CustomSettings.ini 文件的样子:

[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%

答案1

尤里卡!问题解决了!!!

事实证明,我的 Section 标头的名称不能与内置 MDT 变量的名称相同。我的意思是:

[Settings]
Priority=IsVM,IsLaptop,IsDesktop,IsServer,SetComputerName,Default
Properties=ComputerType,MyCustomProperty

请注意,在我的 [设置] 部分中,优先级标题设置为“IsVM、IsLaptop….etc”,

[IsVM]
Subsection=Virtual-%IsVM%

[IsLaptop]
Subsection=Laptop-%IsLaptop%

还要注意,我的自定义部分与我正在测试的内置 MD 变量具有相同的名称(即 IsVM)

通过如下所示更改自定义部分名称并重建我的 MDT DeploymentShare,现在一切都正常了。

[Settings]
Priority=ByVM,ByLaptop,ByDesktop,ByServer,SetComputerName,Default
Properties=ComputerType,MyCustomProperty

[ByVM]
Subsection=Virtual-%IsVM%

[ByLaptop]
Subsection=Laptop-%IsLaptop%

现在,通过这个工作,我可以使用单个部署共享来执行特定的任务序列(即操作系统镜像) 根据检测到的硬件类型分配给特定机器。希望这对某些人有所帮助。

相关内容