$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

相关文章:

  • 2021-12-04
  • 2021-12-25
  • 2022-01-07
  • 2022-01-07
  • 2021-12-15
  • 2021-04-03
  • 2021-11-04
  • 2021-11-19
猜你喜欢
  • 2021-11-19
  • 2022-03-01
  • 2022-12-23
相关资源
相似解决方案