修改IP地址的PowerShell

$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'"

$wmi.EnableStatic("10.0.0.15", "255.255.255.0")

$wmi.SetGateways("10.0.0.1", 1)

$wmi.SetDNSServerSearchOrder("10.0.0.100")

 

来源

==============

Use PowerShell to Configure Static IP and DNS Settings

http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx

posted on 2015-06-03 14:43  中道学友  阅读(2804)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上