mdt 计算机名_配置 MDT 部署共享规则
配置 MDT 部署共享規則Configure MDT deployment share rules
2020/3/6
本文內容
在本主題中,了解如何配置 MDT 規則引擎以訪問其他資源(包括外部腳本、數據庫和 Web 服務),獲取額外信息,而不是將設置直接存儲在規則引擎中。In this topic, you will learn how to configure the MDT rules engine to reach out to other resources, including external scripts, databases, and web services, for additional information instead of storing settings directly in the rules engine. MDT 中的規則引擎功能強大:用于操作系統部署的大多數設置都是通過規則引擎檢索和分配的。The rules engine in MDT is powerful: most of the settings used for operating system deployments are retrieved and assigned via the rules engine. 規則引擎最簡單的形式是 CustomSettings.ini 文本文件。In its simplest form, the rules engine is the CustomSettings.ini text file.
分配設置Assign settings
在使用 MDT 時,你可以采用三種不同方法指定設置:When using MDT, you can assign setting in three distinct ways:
你可以在部署前預先暫存信息。You can pre-stage the information before deployment.
你可以提示用戶或技術人員獲取信息。You can prompt the user or technician for information.
你可以讓 MDT 自動生成設置。You can have MDT generate the settings automatically.
為了演示這三個選項,我們來看看一些示例配置。In order to illustrate these three options, let's look at some sample configurations.
示例配置Sample configurations
在添加更多高級組件(如腳本、數據庫和 Web 服務)之前,請考慮以下常用配置;它們顯示了規則引擎的強大功能。Before adding the more advanced components like scripts, databases, and web services, consider the commonly used configurations below; they demonstrate the power of the rules engine.
按照 MAC 地址設置計算機名Set computer name by MAC Address
如果你具有小型測試環境,或只是想要將設置指定給數量非常有限的計算機,則可以編輯規則,根據給定的 MAC 地址直接指定設置。If you have a small test environment, or simply want to assign settings to a very limited number of machines, you can edit the rules to assign settings directly for a given MAC Address. 如果你具有多臺計算機,最好改為使用數據庫。If you have many machines, it makes sense to use the database instead.
[Settings]
Priority=MacAddress, Default
[Default]
OSInstall=YES
[00:15:5D:85:6B:00]
OSDComputerName=PC00075
在前面的示例中,你將 MAC 地址為 00:15:5D:85:6B:00 的計算機的計算機名設置為了 PC00075。In the preceding sample, you set the PC00075 computer name for a machine with a MAC Address of 00:15:5D:85:6B:00.
按照序列號設置計算機名Set computer name by serial number
分配計算機名的另一個方法是通過計算機序列號標識計算機。Another way to assign a computer name is to identify the machine via its serial number.
[Settings]
Priority=SerialNumber, Default
[Default]
OSInstall=YES
[CND0370RJ7]
OSDComputerName=PC00075
在此示例中,你將序列號為 CND0370RJ7 的計算機的計算機名設置為了 PC00075。In this sample, you set the PC00075 computer name for a machine with a serial number of CND0370RJ7.
基于序列號生成計算機名Generate a computer name based on a serial number
你還可以將規則引擎配置為使用序列號等已知屬性來快速生成計算機名。You also can configure the rules engine to use a known property, like a serial number, to generate a computer name on the fly.
[Settings]
Priority=Default
[Default]
OSInstall=YES
OSDComputerName=PC-%SerialNumber%
在此示例中,你將規則配置為:將計算機名設置為前綴 (PC-) 后跟序列號。In this sample, you configure the rules to set the computer name to a prefix (PC-) and then the serial number. 如果計算機的序列號為 CND0370RJ7,上述配置會將計算機名設置為 PC-CND0370RJ7。If the serial number of the machine is CND0370RJ7, the preceding configuration sets the computer name to PC-CND0370RJ7.
注意Note
使用序列號分配計算機名時請謹慎。Be careful when using the serial number to assign computer names. 序列號可以包含超過 15 個字符,但 Windows 安裝程序將計算機名限制為 15 個字符。A serial number can contain more than 15 characters, but the Windows setup limits a computer name to 15 characters.
基于序列號生成受限的計算機名Generate a limited computer name based on a serial number
若要避免分配長度超過 15 個字符的計算機名,可以通過添加 VBScript 函數,更詳細地配置規則,如下所示:To avoid assigning a computer name longer than 15 characters, you can configure the rules in more detail by adding VBScript functions, as follows:
[Settings]
Priority=Default
[Default]
OSInstall=YES
OSDComputerName=PC-#Left("%SerialNumber%",12)#
在前面的示例中,你仍將規則配置為:將計算機名設置為前綴 (PC-) 后跟序列號。In the preceding sample, you still configure the rules to set the computer name to a prefix (PC-) followed by the serial number. 但是,添加 Left VBScript 函數后,會將規則配置為僅將序列號的前 12 個字符用于名稱。However, by adding the Left VBScript function, you configure the rule to use only the first 12 serial-number characters for the name.
將筆記本電腦添加到 Active Directory 中的不同組織單位 (OU) 中Add laptops to a different organizational unit (OU) in Active Directory
在規則中,你可以找到內置屬性,它們使用 Windows Management Instrumentation (WMI) 查詢來確定要部署的是筆記本電腦、臺式機還是服務器。In the rules, you find built-in properties that use a Windows Management Instrumentation (WMI) query to determine whether the machine you are deploying is a laptop, desktop, or server. 在此示例中,我們假設你想要將筆記本電腦添加到 Active Directory 中的不同 OU。In this sample, we assume you want to add laptops to different OUs in Active Directory. 請注意,ByLaptopType 不是保留字;相反,它是要讀取的部分的名稱。Note that ByLaptopType is not a reserved word; rather, it is the name of the section to read.
[Settings]
Priority=ByLaptopType, Default
[Default]
MachineObjectOU=OU=Workstations,OU=Contoso,DC=contoso,DC=com
[ByLaptopType]
Subsection=Laptop-%IsLaptop%
[Laptop-True]
MachineObjectOU=OU=Laptops,OU=Contoso,DC=contoso,DC=com
相關主題Related topics
總結
以上是生活随笔為你收集整理的mdt 计算机名_配置 MDT 部署共享规则的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何快速的解决Maven依赖冲突
- 下一篇: 618小记