How do I configure network settings during deployment in MDT?

Applies to: Microsoft Deployment Toolkit (MDT) 8456 and later
Last updated: May 2025


Problem

You need to assign specific network settings—such as static IP addresses, DNS servers, or network adapters—during or after Windows deployment using MDT.


Solution

By default, MDT uses DHCP for IP configuration. However, you can customize network settings using CustomSettings.ini, unattend.xml, or Task Sequence steps to apply static IPs or specific configurations.


Option 1: Use Unattend.xml for Static IP (Limited Use)

This method applies to systems where the network settings are known ahead of time and fixed.

Step 1: Open Task Sequence > OS Info > Edit Unattend.xml

  • Navigate to:
    • Microsoft-Windows-TCPIP > Interfaces
  • Add IP address, subnet, gateway, and DNS server values manually.

Not recommended for variable deployments or large environments—better for static lab machines.


Option 2: Configure via Task Sequence + Scripts (Recommended)

Use Task Sequence steps that run PowerShell or CMD scripts to apply network settings dynamically.

Example PowerShell Script (Set-IP.ps1):

New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.100 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 8.8.8.8, 8.8.4.4

Step-by-Step:

  1. Save the script in:
    • <DeploymentShare>\Scripts\Set-IP.ps1
  2. In your Task Sequence:
    • Click Add > General > Run PowerShell Script
    • Command line: powershell.exe -ExecutionPolicy Bypass -File "%SCRIPTROOT%\Set-IP.ps1"

You can conditionally run different scripts based on roles, location, or hardware.


Option 3: Use MDT Rules with Static IP Variables (Less Common)

Add the following to CustomSettings.ini for static IP deployments:

SkipLocaleSelection=YES
SkipTimeZone=YES
SkipDomainMembership=YES
SkipComputerBackup=YES
SkipApplications=YES
SkipSummary=YES
SkipFinalSummary=YES

IPAddress=192.168.1.100
SubnetMask=255.255.255.0
Gateway=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4

These variables are not always reliable depending on Windows version and driver load timing.


Best Practices

  • Prefer DHCP for scalability unless static IPs are absolutely required.
  • Use Task Sequence–based scripting for flexibility and logging.
  • Validate adapter names (e.g., “Ethernet”, “Wi-Fi”) via logs or Get-NetAdapter.

Notes

  • Scripts must run after the OS is installed (State Restore phase).
  • MDT logs network configuration steps in:
    • ZTIGather.log
    • ZTINICConfig.log
  • Combining scripts with conditionals (e.g., by location or model) improves automation and avoids errors.

You may also like...