# IP address or DnsHostName of your Dhcp Server $dhcpServer = '192.168.8.1' # Name of the network adapter to enable DHCP on $routerNetAdapterName = 'Ethernet1' $dhcpAddress = [Net.Dns]::GetHostEntry($dhcpServer) if(!$dhcpAddress){ Write-Warning "Unable to identify IP address of [$dhcpServer]" break }else{ $dhcpServerIP = $dhcpAddress.AddressList[0] }