How can I set a remote computer to use DHCP instead of a static IP address?

I have tried using Set-NetIPInterface -DHCP Enabled however this requires WinRM which is disabled on my network.

How can I do it using a built in Windows technology like Netsh (I can't download PSExec).

  • Depending on the client version, you may have to use netsh anyway, the Net cmdlets require Windows 8 or newer, or Server 2012 or newer, as those cmdlets are part of the OS.
    – Davidw
    Aug 9 '17 at 2:18
  • I'm using Server 2012. But it doesn't matter because WinRM is disabled. Aug 9 '17 at 2:24
  • Can you explain your whole scenario a little better? This sounds like a very in-the-weeds question, and you might get a more useful answer if you explain the entire problem that you're facing.
    – mfinni
    Aug 10 '17 at 2:05

WMI works well:

$networkAdapterConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName 'SomeComputerName'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.