Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

changing ip address remotely causes disconnection

$
0
0

when i try to run this and change the ip address of a machine remotely, it disconnects before I can change the ip gateway. how can i get this working without getting disconnected?

$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" -ComputerName sql2012
$wmi.EnableStatic("10.245.10.20", "255.255.0.0")
$wmi.SetGateways("10.245.0.1", 1)
$wmi.SetDNSServerSearchOrder("10.245.1.14")


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>