Reply to Message

View discussion in a popup

Replying to:
Alex_Romeo
Leadership
Leadership

HI,

The network parameters must be entered without quotes and double quote.

The double DNS must be separated by a comma.

Try like this:

New-VM -Name 'WEB001' -VMHost $VMHost -Datastore 'DST_XXX' -Template $Template -OSCustomizationSpec $Spec | Set-OSCustomizationNicMapping -IPmode UseStaticIP -IpAddress 192.168.0.1 -SubnetMask 255.255.255.0 -DefaultGateway 192.168.0.1 -Dns X.X.X.X.X,X.X.X.X.X

Set-OSCustomizationNicMapping

--------------  Example 3 --------------

C:\PS>Get-OSCustomizationSpec mySpec | Get-OSCustomizationNicMapping | Set-OSCus
tomizationNicMapping -IpMode UseStaticIp -IpAddress 10.10.0.1 -SubnetMask 255.25
5.255.0 -DefaultGateway 10.10.0.1 -AlternateGateway 10.10.0.1 -Dns 10.10.150.1 -
PrimaryWins 10.10.150.2

Alessandro Romeo

Blog: https://www.aleadmin.it/
Reply
0 Kudos