none
Maximum number of characters in MDT Rules? RRS feed

  • Question

  • Good Morning all, 

    Last night I have encountered a very unusual error in MDT.

    After I have tried to add comments to particular sections in my MDT Rules, I found that I'm unable to type anything else in the MDT Rules.

    Weirdly enough, the error only seems to be for custom.ini settings and not for the bootstrap.

    Any idea on how to get rid of it as I don't want to create another deployment share just because of this.

    Saturday, March 2, 2019 8:13 AM

All replies

  • Hi, 

    Just a quick update.

    I have tried to create a new deployment share but I can't seem to paste all the settings I have in the MDT rules.

    It only works in the bootstrap.ini.

    Saturday, March 2, 2019 8:32 AM
  • n 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. The rules engine in MDT is powerful: most of the settings used for operating system deployments are retrieved and assigned via the rules engine. In its simplest form, the rules engine is the CustomSettings.ini text file.

    Assign settings

    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.
    • You can have MDT generate the settings automatically.

    In <g class="gr_ gr_22 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="22" id="22">order</g> illustrate these three options, let's look at some sample configurations.

    Sample configurations

    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.

    Set computer name by MAC Address

    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

    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.

    syntax<button class="action" data-bi-name="copy" style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;font-family:inherit;margin:0px;box-sizing:inherit;cursor:pointer;padding:2px 10px;border-left-width:1px;display:flex;-webkit-box-align:center;align-items:center;">Copy</button>
    [Settings]
    Priority=SerialNumber, Default
    [Default]
    OSInstall=YES
    [CND0370RJ7]
    OSDComputerName=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.

    syntax<button class="action" data-bi-name="copy" style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;font-family:inherit;margin:0px;box-sizing:inherit;cursor:pointer;padding:2px 10px;border-left-width:1px;display:flex;-webkit-box-align:center;align-items:center;">Copy</button>
    [Settings]
    Priority=Default
    [Default]
    OSInstall=YES
    OSDComputerName=PC-%SerialNumber%
    

    In this sample, you configure the rules to set the computer name to a prefix (PC-) and then the serial number. 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. 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

    To avoid assigning a computer name longer than 15 characters, you can configure the rules in more detail by adding VBScript functions, as follows:

    syntax<button class="action" data-bi-name="copy" style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;font-family:inherit;margin:0px;box-sizing:inherit;cursor:pointer;padding:2px 10px;border-left-width:1px;display:flex;-webkit-box-align:center;align-items:center;">Copy</button>
    [Settings]
    Priority=Default
    [Default]
    OSInstall=YES
    OSDComputerName=PC-#Left("%SerialNumber%",12)#
    

    In the preceding sample, you still configure the rules to set the computer name to a prefix (PC-) followed by the serial number. However, by adding the Left VBScript function, you configure the rule to use only the first 12 serial-number characters for the name.

    Add laptops to a different organizational unit (OU) in Active Directory

    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. In this sample, we assume you want to add laptops to different OUs in Active Directory. Note that ByLaptopType is not a reserved word; rather, it is the name of the section to read.

    syntax<button class="action" data-bi-name="copy" style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:inherit;font-family:inherit;margin:0px;box-sizing:inherit;cursor:pointer;padding:2px 10px;border-left-width:1px;display:flex;-webkit-box-align:center;align-items:center;">Copy</button>
    [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

    Saturday, March 2, 2019 1:50 PM