Deactivate a DHCP scope using Powershell

Mike R 81 Reputation points
2021-10-28T14:45:14.463+00:00

Hello,

I was wondering has anyone deactivated DHCP scopes using Powershell below? I'm just learning how to use Powershell and I know how to update Scope Options using Powershell but I was wondering can you Deactivate it using PowerShell? I would like to do many pulling from a list via a CSV file.

Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,023 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 45,091 Reputation points
    2021-10-28T14:58:45.547+00:00

    Use Set-DhcpServerv4Scope and the -State parameter with a value of "InActive".


1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,371 Reputation points
    2021-10-29T16:32:55.64+00:00

    Hello @Mike R ,

    To disable the created scope, use this command:

    Set-DhcpServerv4Scope -ComputerName DHCPServer -ScopeId 10.1.1.0 -State InActive

    To Remove the created scope from the DHCP server use this command

    Remove-DHCPServerv4Scope -ComputerName DHCPServer -ScopeId 10.1.1.0 -Force

    --------

    --If the reply was helpful, please don’t forget to upvote or accept as answer.--