Get DHCP Server address with only Powershell, like ipconfig /all

5.1k views Asked by At

Get-NetIPConfiguration doesn't show DHCP server's ip address information. How can I do same as ipconfig /all but with PowerShell native tools?

1

There are 1 answers

0
CFou On BEST ANSWER

Use this :

Get-CimInstance Win32_NetworkAdapterConfiguration -Filter "DHCPEnabled=$true" | Select DHCPServer

if you use Windows 7 / 2008 R2 or below :

Get-WMIObject Win32_NetworkAdapterConfiguration -Filter "DHCPEnabled=$true" | Select DHCPServer

Both will retrieve only interface with DHCP enabled, remove the filter if you want them all