I have a large number of domains that I need to update the default TTL value for, but I have not found the exact contructs to make the code work. Here is a rough version of some code I generally use for other tasks. Hopefully, someone can point me in the write direction.
CODE
' This code will hopefully modify the default TTL for a DNS zone.
' Default TTL constrants
const MODIFY_DEFAULT_TTL = <0:0:0:30>
' Option Explicit
Dim objExcel
Dim objSpread
Dim intRow
Dim strSheet
Dim strZone
' File containing all zones to be updated.
strSheet = "C:\Book1.xls"
' Open the Excel spreadsheet
Set objExcel = CreateObject("Excel.Application")
Set objSpread = objExcel.Workbooks.Open(strSheet)
intRow = 2
' Do Loop
Do Until objExcel.Cells(intRow,1).Value = ""
strZone = Trim(objExcel.Cells(intRow, 1).Value)
strServer = "<serverName>" ' e.g. ns1.corp.com
intTTL = MODIFY_DEFAULT_TTL
set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS")
set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""")
set objDNSZone = objDNS.Get("MicrosoftDNS_Zone.ContainerName=""" & _
strZone & """,DnsServerName=""" & _
objDNSServer.Name & """,Name=""" & strZone & """")
strNull = objDNSZone.TTL(intTTL)
objDNSZone.Put_
intRow = intRow + 1
Loop
objExcel.Quit
'End loop
WScript.Echo "Default TTL'S updated"
Thanks
George