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 for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Answer accepted by question author
  1. Rich Matheisen 47,941 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 40,031 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.--


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.