Random Guy
Random Guy

Reputation: 81

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

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

Upvotes: 2

Views: 6622

Answers (1)

CFou
CFou

Reputation: 1180

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

Upvotes: 4

Related Questions