How to Delete all DHCP scopes from MS 2008 DHCP


I have imported a netsh file into my 2008 dev server. Now I want to remove them all and start blank.

I dont want to have to click one by one and select delete. It will take to long. Is there a quick way to delete all without deleted the DHCP server

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can try to remove the dhcp server role, specifying that you also remove the data and configuration. Then reinstall the dhcp server role.
The other way around might be to use a netsh script file. Since you have the original file, changing it to delete the scopes it added might be a matter of find/replace command.
richsarkAuthor Commented:
Great.  So what would be the command to delete the Scopes if I use find/replace ?
"add scope"
"delete scope"

However, add scope has more parameters than delete scope.
Now, if all your scopes have the same subnet mask (or if there are few subnet masks) you can:
1/ replace "add scope" by "delete scope"
2/ replace "" by "DHCPFULLFORCE"
(I used as the subnet mask to be replaced. If you have 4 different subnet masks, use them all, one after the other, as the string to be replaced by DHCPFULLFORCE)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.