That works great.. I would probably use a calculated property so it returns an object instead of string
Get-WMIObject -Class "MicrosoftDNS_AType" -Namespace
"root\MicrosoftDNS" -Comp $DNSServer -Filter "DomainName='$Domain'" |
Select-Object
OwnerName,@{n="TimeStamp";e={(Get-Date("01/01/1601")).AddHours($_.TimeStamp)}}
This way you could | to a filter like ... | ?{$_.TimeStamp -gt $date} or ... | ?{$_.OwnerName -match }
----- Original Message ----- From: "Chris Dent" To: Sent: Thursday, April 17, 2008 5:09 PM Subject: RE: [ActiveDir] Aging/Scavenging on _msdcs. URGENT
Good of you to offer I think I have it though, well one of many possible, any improvements recommended?
$DNSServer = "" $Domain = ""
Get-WMIObject -Class "MicrosoftDNS_AType" -Namespace "root\MicrosoftDNS" ` -ComputerName $DNSServer -Filter "DomainName='$Domain'" ` | ForEach { ($_.OwnerName) + " " + ` (Get-Date("01/01/1601")).AddHours($_.TimeStamp) }
Might be easier to read spread out though.
Chris
-----Original Message----- From: ActiveDir-owner@mail.activedir.org [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Brandon Shell Sent: 17 April 2008 20:53 To: ActiveDir@mail.activedir.org Subject: Re: [ActiveDir] Aging/Scavenging on _msdcs. URGENT
I will rewrite them in Powershell if you like. If you want it as a learning exercise, I am here to help with that as well.
Unknown Guy w/ Dean
On 4/17/08, Chris Dent wrote: > Hey Yann, > > > > Tthere are a few options here. > > > > First of all, you can get the information using DNSCMD as follows: > > > > DNSCMD /ZonePrint /detail > > > > But, it's not the easiest format to decipher. > > > > I've found a little script I wrote last year that'll do it with WMI. You'd > want to run it with "cscript " or you'll get a lot of popup > boxes. > > > > The format is easy to modify if you need. > > > > Really should rewrite these into PowerShell. > > > > Chris > > > > From: ActiveDir-owner@mail.activedir.org > [mailto:ActiveDir-owner@mail.activedir.org] On Behalf Of Chris Dent > Sent: 17 April 2008 17:27 > To: ActiveDir@mail.activedir.org > Subject: RE: [ActiveDir] Aging/Scavenging on _msdcs. URGENT > > > > > > It can be extracted easily enough using WMI, I'll have to take a few minutes > to look at the returned string to get the format though. I'll get back to > you later on, must head off home now  > > Chris > > -----Original Message----- > From: ActiveDir-owner@mail.activedir.org on behalf of Yann > Sent: Thu 17/04/2008 17:22 > To: ActiveDir@mail.activedir.org > Subject: RE : RE: RE : RE: [ActiveDir] Aging/Scavenging on > _msdcs. URGENT > > Thx. > > Any idea on how to know in advance how many and what records will be > scavenged ? (ldifde, script,etc..) > > Just to identify exactly what will be deleted from DNS. > > Thx and have a nice day. > > Yann > > Chris Dent a écrit : > > If Aging isn't enabled on a zone the TimeStamp value is, as far as I'm > aware, not replicated. > > It's worth turning on View / Advanced when configuring Aging. A value is set > to state that the zone cannot be scavenged before a certain date, found > under the Aging window. It's used to ensure full replication of TimeStamps > has completed prior to the first Scavenging attempt and should be the value > of the Refresh interval + 1 hour (or there abouts). > > Chris > > -----Original Message----- > From: ActiveDir-owner@mail.activedir.org on behalf of Yann > Sent: Thu 17/04/2008 16:23 > To: ActiveDir@mail.activedir.org > Subject: RE : RE: [ActiveDir] Aging/Scavenging on _msdcs. URGENT > > OK,Thx for your answer Chris. > > Last Q. > > I have found several of my DCs with a Registration Timestamp set to > 2007/07/20 on their A records (. dns zone). > I know that these DCs are up & running and it seems that no refresh to their > A record have been done... > > Any clues why operationnal DCs did not refresh their records ? > > Many thx. > > Yann > > Chris Dent a écrit : > > 1. First bit: > > Yep, it is. > > Second bit: > > That's the Registration Timestamp, not the deletion timestamp. > > What are you thinking of setting Aging to? > > Service Records will be Refreshed / Updated by the Domain Controllers once > every 24 hours. > > I recommend you consider leaving the default 7 Days No-Refresh and 7 Days > Refresh there. At any point during either interval the record will accept an > Update request so changes are still no problem. > > 2. All Dynamically Added records are effected by Aging / Scavenging. Only > static records (records with no time-stamp) are immune. > > -----Original Message----- > From: ActiveDir-owner@mail.activedir.org on behalf of Yann > Sent: Thu 17/04/2008 15:33 > To: ActiveDir@mail.activedir.org > Subject: [ActiveDir] Aging/Scavenging on _msdcs. URGENT > > Hello, > > We are about to activate the aging/scavenging on our DNS AD-integrated. > questions: > 1) is it safe to activate aging/scavenging on _msdcs. ? I have many srv > records that are timestamped to be deleted on 2008/04/10. > > 2) will clustered servers will also be affected by aging/scavenging ? > > Thx > > __________________________________________________ > Do You Yahoo!? > En finir avec le spam? Yahoo! Mail vous offre la meilleure protection > possible contre les messages non sollicités > http://mail.yahoo.fr Yahoo! Mail > > > > __________________________________________________ > Do You Yahoo!? > En finir avec le spam? Yahoo! Mail vous offre la meilleure protection > possible contre les messages non sollicités > http://mail.yahoo.fr Yahoo! Mail > > > > __________________________________________________ > Do You Yahoo!? > En finir avec le spam? Yahoo! Mail vous offre la meilleure protection > possible contre les messages non sollicités > http://mail.yahoo.fr Yahoo! Mail > > List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.activedir.org/ma/default.aspx
List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.activedir.org/ma/default.aspx
List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.activedir.org/ma/default.aspx
|