$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration -computername . | where{$_.IPEnabled -eq $true -and $_.DHCPEnabled -eq $true}
Foreach($NIC in $NICs) {
$ip = “192.168.1.10”
$gateway = “192.168.1.254”
$subnet = “255.255.255.0”
$dns = “8.8.8.8”,”192.168.1.254″
$NIC.EnableStatic($ip, $subnet)
$NIC.SetGateways($gateway)
$NIC.SetDNSServerSearchOrder($dns)
$NIC.SetDynamicDNSRegistration(“FALSE”)
}
IPConfig /all
Recent Comments