Delete the Root Hints (VBScript)

This code can be found in Chapter 12 of Windows Server 2003 Security Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftDNS")
Set colItems = objWMIService.ExecQuery("Select * From MicrosoftDNS_RootHints")
For Each objItem in colItems
    objItem.DeleteRootHint()
    WScript.Echo "Root Hints deleted"
Next

This code has been viewed 1332 times.

New from the creators of TechTasks.com: StatSheet.com