Wednesday, 27 June 2018

Configure IPv4 IP Address, DNS servers and DNS Suffix from within Powershell

I recently used this on a Hyper-V build.  It should provide enough network connectivity to add your server to the Active Directory domain.

Find connected NICs and interface names

 

Get-NetAdapter

 

 

Configure IP address

 

New-NetIPAddress -InterfaceAlias "NIC1" -IPAddress 10.20.0.141 -AddressFamily IPv4 -PrefixLength 24 -DefaultGateway 10.20.0.1

 

 

Configure DNS Servers

 

 

Set-DnsClientServerAddress -InterfaceAlias "NIC1" -ServerAddresses 10.20.0.133

 

 

Configure the suffix search list

 

 

Set-DnsClientGlobalSetting -SuffixSearchList corp.contoso.com

 

 

 

No comments:

Post a Comment