Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

command line to uncheck 'Delete this record when it becomes stale'

1,401 views
Skip to first unread message

Troy

unread,
Mar 26, 2009, 6:14:11 PM3/26/09
to

We are in the process of preparing our AD zone to enable scavenging. I have
exported our zone to get the current timestamps (it was enabled once in the
past and deleted things it shouldn't have...management is gun shy now). I
would like to take a list of records and send it through a FOR loop to
uncheck the "Delete this record when it becomes stale" for our records that
are not ment to be scavenaged.

The problem is I can't find any that does this through a command line. I
found this: http://technet.microsoft.com/en-us/library/cc771570.aspx

It states "To reset aging and scavenging properties for a specified resource
record using a command line", Which is exactly what I want to do....but
either it doesn't work or my syntax is wrong.

This is what I tried:

C:\>dnscmd . /Config <RECORD-FQDN> /ScavengingInterval 0
DNS Server failed to reset registry property.
Status = 9601 (0x00002581)

Command failed: DNS_ERROR_ZONE_DOES_NOT_EXIST 9601 (00002581)


It appears this questions has been posted in the past with no answer. I
figured I
would try again...maybe something has been changed.

http://www.tech-archive.net/Archive/Windows/microsoft.public.windows.server.dns/2008-05/msg00128.html

Ace Fekay [Microsoft Certified Trainer]

unread,
Mar 26, 2009, 11:10:06 PM3/26/09
to
In news:DE0DD8CA-45C0-4873...@microsoft.com,
Troy <Tr...@discussions.microsoft.com>, posted the following:

The syntax is:
dnscmd <ServerName> /Config {<ZoneName>|..AllZones} /ScavengingInterval
<Value>

Not sure if it will work with a host - I've never tried it. I believe it
only works at the zone level, which the syntax implies.

Nonetheless, you didn't specify the zone name in your syntax, which was
apparent with the error message you received saying zone does not exist.
Try:

dnscmd /Config domain.com hostname /ScavengingInterval 0


--
Ace

This posting is provided "AS-IS" with no warranties or guarantees and
confers no rights.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSA Messaging, MCT
Microsoft Certified Trainer
ace...@mvps.RemoveThisPart.org

For urgent issues, you may want to contact Microsoft PSS directly. Please
check http://support.microsoft.com for regional support phone numbers.

Troy

unread,
Mar 27, 2009, 9:45:01 AM3/27/09
to

Thanks for the reply.

I think you're right about this only working at the zone level. I wonder if
there is a different way to do this..

I assume you mean I didn't specify the servername? The zone name would be
in the FQDN. According to the <ServerName> parameter, you can type the
servername or just a period (.)....I've tried both. I have follow the syntax
rules from:
http://technet.microsoft.com/en-us/library/cc771570.aspx
I tried multiple variations.

I also tried your syntax and just got this error

Command failed: ERROR_INVALID_PARAMETER 87 (00000057)

It seems weird that MS would give you the /AgeAllRecords switch to timestamp
all records by not give you a way to remove it from a command line.

Ace Fekay [Microsoft Certified Trainer]

unread,
Mar 27, 2009, 11:29:41 AM3/27/09
to
In news:E80E9D5E-B749-4D70...@microsoft.com,

Troy <Tr...@discussions.microsoft.com>, posted the following:
> Thanks for the reply.
>
> I think you're right about this only working at the zone level. I
> wonder if there is a different way to do this..
>
> I assume you mean I didn't specify the servername? The zone name
> would be in the FQDN. According to the <ServerName> parameter, you
> can type the servername or just a period (.)....I've tried both. I
> have follow the syntax rules from:
> http://technet.microsoft.com/en-us/library/cc771570.aspx
> I tried multiple variations.
>
> I also tried your syntax and just got this error
>
> Command failed: ERROR_INVALID_PARAMETER 87 (00000057)
>
> It seems weird that MS would give you the /AgeAllRecords switch to
> timestamp all records by not give you a way to remove it from a
> command line.

I don't know if it is weird, rather just what's available.

My suggestion was to put in the zone name, then the hostname, in an attempt
to see if it would take it as a hostname config request, instead of the
whole zone. Apparently it didn't work. Sorry. Looks like it is at the zone
level only.

Try this tool. It is an export/import tool. Export the records to a file,
look at the export file for aging settings. I'm not sure if it will show
aging. It's been quite a few years since I've used it. If it is there, try
changing it, and test an import to a test DNS server to see if it will take
the altered file.

DNSDump by Dean Wells
http://www.reskit.net/DNS/dnsdump.cm_
(note - there's an underscore at the end of the link)

Ace

Stoneman

unread,
May 27, 2009, 9:33:01 PM5/27/09
to
The only way I know of to "uncheck" the stale checkbox is to delete the DNS
record and readd it. Readding creates a static record by default. The
/RecordDelete and /RecordAdd commans can be executed in rapid successtion
aimed at the same DNS server so the record won't even look like it's been
deleted. (of course you'd need a second set of DNSCMD commands for the PTR
record.

In order to "check" the checkbox for a static record, you'd need to delete
it and readd it using the /Aging switch within the DNSCMD command.

Not quite as clean as a pure "modify" command, but it works.


"Ace Fekay [Microsoft Certified Trainer]" wrote:

0 new messages