Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing stale Resource Records before scavenging 3

Status
Not open for further replies.

acl03

MIS
Jun 13, 2005
1,077
0
0
US
Is this possible?

We have had a domain running for about 4 years, and never done any type of cleanup in DNS. I am looking into scavenging aged records, but I'd like to see which will be deleted before I do it.

Any ideas?

Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 
Awesome, thanks Joey.

Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 
I'm not too sure what that script is acually doing...it appears to be pulling some sort of information from the internet? If so, won't work for me here behind our firewall...

Code:
Set colItems = objWMIService.ExecQuery("SELECT * FROM MicrosoftDNS_AType " &_
  " WHERE ContainerName='internal.highorbit.co.uk' AND TimeStamp<>0")



Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 
Those are just example values, not something I expected anyone to use (where I am the script author).

You should replace the entry in this line with your own Domain Controller name:

Set objWMIService = GetObject("winmgmts:\\dc01.internal.highorbit.co.uk\root\MicrosoftDNS")

And the domain name in this with your AD domain:

Set colItems = objWMIService.ExecQuery("SELECT * FROM MicrosoftDNS_AType " &_
" WHERE ContainerName='internal.highorbit.co.uk' AND TimeStamp<>0")

It uses WMI to query for DNS information on the specified DC, extracting A records for the specified domain.

You may also choose to repeat the query for MicrosoftDNS_CNAMEType and MicrosoftDNS_SRVType as both of those are also subject to Scavenging.

HTH

Chris
 
Chris,

Thanks. I was just looking at it again realizing that I needed to modify it to look at my local environment.

It is working now, and lists a TON of records, ones that I know are still valid. I guess I need to do some reading about refresh and no-refresh intervals and how they work. Thanks for your help.

Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 
And a star to you "TeflonJim" for writing the valuable script.


Joey
CCNA, MCSA 2003, MCP, A+, Network+, Wireless#
 
And another one...

Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 

The results of the script are open to a little interpretation.

To get an accurate list of records that would be Scavenged you would first have to enable Aging (but not automatic scavenging). Until you do that TimeStamps associated with records are not properly replicated, that means you can get different results for stale records depending on the server you query.

It's all harmless as long as no one enables automatic scavenging, and no one starts a manual scavenging cycle.

I keep meaning to go and have another look at the replication of the dnsRecord attribute (where the time stamp lives).

Chris
 
Chris,

Sorry for the delayed response, been tied up with other things.

How do I enable Aging without turning automatic scavenging?

Currently, the refresh and no-refresh intervals are at the 7-day default values.

This article gives a pretty clear definition of how aging/scavenging works, but I don't see any way to "enable" aging...



Thanks!

Thanks,
Andrew

[smarty] Hard work often pays off over time, but procrastination pays off right now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top