[] to retrieve network adapter information such as MAC addresses and adapter types
PS> Get-WmiObject -Class Win32_NetworkAdapter -ComputerName .
[] to find the DHCP-enabled adapters on a computer
PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "DHCPEnabled=true" -ComputerName .
[] to find the IP-enabled adapters on a computer
PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled=true and DHCPEnabled=true" -ComputerName .
[] to enable DHCP on all adapters
PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=true -ComputerName .
| ForEach-Object -Process {$_.EnableDHCP()}
[] to releases all DHCP leases on adapters on the local computer that are obtaining DHCP leases from 192.168.1.254
PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled=true and DHCPEnabled=true" -ComputerName .
| Where-Object -FilterScript {$_.DHCPServer -contains "192.168.1.254"}
| ForEach-Object -Process {$_.ReleaseDHCPLease()}
[] to renew a DHCP lease
PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPEnabled=true and DHCPEnabled=true" -ComputerName .
| Where-Object -FilterScript {$_.DHCPServer -contains "192.168.1.254"}
| ForEach-Object -Process {$_.ReleaseDHCPLease()}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment