You can modify the default NIC mapping object of a customization specification and apply the specification on a newly created virtual machine.


Create a nonpersistent customization specification for Windows operating systems.

New-OSCustomizationSpec -Type NonPersistent -Name Spec -OSType Windows -Workgroup Workgroup -OrgName Company -Fullname User -ProductKey “valid_key” -ChangeSid -TimeZone "Central European" -NamingScheme VM

View the default NIC mapping objects of the Spec specification.

Get-OSCustomizationNicMapping -Spec Spec | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress -SubnetMask -DefaultGateway -Dns 172.16.1

Each customization specification object has one default NIC mapping object.


Modify the default NIC mapping object of the Spec customization specification to use static IP.

Get-OSCustomizationNicMapping -Spec Spec | Set-OSCustomizationNicMapping  -IpMode UseStaticIP -IpAddress -SubnetMask -DefaultGateway -Dns

Create a new virtual machine named VM1 from a template, and apply the static IP settings.

New-VM -Name VM1 -VMHost Host -Datastore Storage1 -OSCustomizationSpec Spec -Template Template