clear TCP/IP Gateway using WMI
来源:互联网 发布:怪物猎人x桐花套数据 编辑:程序博客网 时间:2024/05/17 01:35
solution 1:
To clear the gateway, set your gateway to the same IP you use on EnableStatic.
solution 2:
First we use WMI to grab the NIC by name ($NicName):
$Adapter
=
Get-WmiObject
-Class
Win32_NetworkAdapter
-Filter
"NetConnectionID='$NicName'"
Then we get the configuration for the NIC by calling it using the index number of the NIC we got from above:
$Nic
=
Get-WmiObject
-Class
Win32_NetworkAdapterConfiguration
-Filter
"Index=$($Adapter.Index)"
Next, we need to grab the NIC’s IP and subnet mask so we can assign them again later:
$NicIP
=
$Nic
.IpAddress[0]
$NicMask
=
$Nic
.IpSubnet[0]
The, we set the NIC to DHCP,
$Nic
.EnableDhcp() |
Out-Null
And then back to static, using the IP and mask we retrieved from above:
$Nic
.EnableStatic(
$NicIp
,
$NicMask
) |
Out-Null
0 0
- clear TCP/IP Gateway using WMI
- Configuring a Gateway of Last Resort Using IP Commands
- 用c#更改IP.Gateway,Mask等的和对.net下调用WMI的认识
- Understanding TCP/IP: A Clear And Comprehensive Guide
- Understanding Tcp/ip: A Clear And Comprehensive Guide
- 用c#更改IP.Gateway,Mask等的和对.net下调用WMI的认识(原创)
- 利用WMI修改本机Gateway,DNS
- Set IP/Gateway/Dns
- 查看IP,DNS,GATEWAY
- 获取ip wmi正解
- (3)Python笔记:使用WMI模块+TCP/IP来远程监控系统信息
- Using Android Debug Bridge (ADB) via TCP/IP
- Using Android Debug Bridge (ADB) via TCP/IP
- Intro to Configure IPsec VPN (Gateway-to-Gateway ) using Strongswan
- Linux修改网关Gateway、IP
- 10/21 IP 与 GATEWAY
- Using Integrated SOA Gateway in Oracle EBS
- Using Integrated SOA Gateway in Oracle EBS
- 在 SharePoint Server 2013 中管理 Excel Services
- 设计模式原理及应用场合(转)
- 致橡树
- Thinking in Java学习笔记 Thread.UncaughtExceptionHandler接口实现捕获线程内异常
- linux shell 统计项目目录存储信息
- clear TCP/IP Gateway using WMI
- JAVA调用Google Custom Search API
- Linux内核模块管理
- 数据库连接池
- JAVA常用系统变量
- Tomcat7.0.59 不能解析EL表达式
- 【SICP练习】88 练习2.60
- 华为面试题:四则运算 C语言源码
- 组合模式