get dns/dhcp address powershell 4.0 -


using powershell return dns servers , dhcp address variables. have tried get-dns cmdlet powershell doesn't recognize it.

it should return ex. $dns1 = 1.1.1.1 $dns2 = 2.2.2.2 $dhcp = 3.3.3.3

below command gives properties of network adapter configuration:

get-wmiobject win32_networkadapterconfiguration | select * 

using inside parenthesis give access individual properties of output:

(get-wmiobject win32_networkadapterconfiguration | select *)[2].dhcpserver (get-wmiobject win32_networkadapterconfiguration | select *)[2].dnsserversearchorder 

here [2] index number of network adapter looking @ (if have multiple)


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -