December 2003
Intermediate to advanced
416 pages
13h 50m
English
Now that we can see what
values
have been set on our name server, we can change some of them. We
simply need to set the property method (e.g.,
EventLogLevel) to the correct value. This example
shows how to do it:
strServer = "terminator.movie.edu"
on error resume next
set objDNS = GetObject("winMgmts:\\" & strServer & "\root\MicrosoftDNS")
set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""")
Wscript.Echo objDNSServer.Name & ":"
' See Table 14-1 for an explanation of each of these settings
objDNSServer.EventLogLevel = 4
objDNSServer.LooseWildcarding = TRUE
objDNSServer.MaxCacheTTL = 900
objDNSServer.MaxNegativeCacheTTL = 60
objDNSServer.AllowUpdate = 3
objDNSServer.Put_
if Err then
Wscript.Echo " Error occurred: " & Err.Description
else
WScript.Echo " Change successful"
end ifNote that we had to call Put_ at the end. If we
hadn’t, none of the changes would have been
committed. This is similar to ADSI’s
SetInfo method, which must be called after
modifying an object’s property cache to make the
change actually take effect.
Read now
Unlock full access