|
|
I am querying DNS records in a zone, but would like to filter on A records only. Is there a way I can determaine this based on the AD attribtes of a resource record? I can't seem to determaine what value holds this information. I suspect dnsrecord but I'm nor sure what part relates to the record type.
Set objDNS = GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com")
For Each objRecord in objDNS wscript.echo objRecord.Get("dc") Next
|
|
dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A
Deji
"Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com...
[Quoted Text] >I am querying DNS records in a zone, but would like to filter on A records > only. Is there a way I can determaine this based on the AD attribtes of a > resource record? I can't seem to determaine what value holds this > information. I suspect dnsrecord but I'm nor sure what part relates to the > record type. > > Set objDNS = > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") > > > For Each objRecord in objDNS > wscript.echo objRecord.Get("dc") > Next
|
|
I wold like to determain this from the AD object, not be using the external tool dnscmd.
Thanks
"A, Deji" wrote:
[Quoted Text] > dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A > > Deji > > "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message > news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com... > >I am querying DNS records in a zone, but would like to filter on A records > > only. Is there a way I can determaine this based on the AD attribtes of a > > resource record? I can't seem to determaine what value holds this > > information. I suspect dnsrecord but I'm nor sure what part relates to the > > record type. > > > > Set objDNS = > > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") > > > > > > For Each objRecord in objDNS > > wscript.echo objRecord.Get("dc") > > Next > >
|
|
what external tool? DNSCMD is the commandline DNS management interface for Windows. It's built-in and you can script it, too.
Deji "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:CE4B00DE-25D7-4DB5-A704-E2A485C1B4FB[ at ]microsoft.com...
[Quoted Text] >I wold like to determain this from the AD object, not be using the external > tool dnscmd. > > Thanks > > "A, Deji" wrote: > >> dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A >> >> Deji >> >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message >> news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com... >> >I am querying DNS records in a zone, but would like to filter on A >> >records >> > only. Is there a way I can determaine this based on the AD attribtes of >> > a >> > resource record? I can't seem to determaine what value holds this >> > information. I suspect dnsrecord but I'm nor sure what part relates to >> > the >> > record type. >> > >> > Set objDNS = >> > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") >> > >> > >> > For Each objRecord in objDNS >> > wscript.echo objRecord.Get("dc") >> > Next >> >>
|
|
External of my script. I want to grab the information directly from Active Directory and not reply on the output of some other function or program.
"A, Deji" wrote:
[Quoted Text] > what external tool? DNSCMD is the commandline DNS management interface for > Windows. It's built-in and you can script it, too. > > Deji > "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message > news:CE4B00DE-25D7-4DB5-A704-E2A485C1B4FB[ at ]microsoft.com... > >I wold like to determain this from the AD object, not be using the external > > tool dnscmd. > > > > Thanks > > > > "A, Deji" wrote: > > > >> dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A > >> > >> Deji > >> > >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message > >> news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com... > >> >I am querying DNS records in a zone, but would like to filter on A > >> >records > >> > only. Is there a way I can determaine this based on the AD attribtes of > >> > a > >> > resource record? I can't seem to determaine what value holds this > >> > information. I suspect dnsrecord but I'm nor sure what part relates to > >> > the > >> > record type. > >> > > >> > Set objDNS = > >> > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") > >> > > >> > > >> > For Each objRecord in objDNS > >> > wscript.echo objRecord.Get("dc") > >> > Next > >> > >> > >
|
|
I see....
Can you use WMI? If so, then what you are looking for is "MicrosoftDNS_AType". For example:
MyDNSServer = "name-of-a-DNS-server" Set objAction = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & _ "\root\MicrosoftDNS")
Set myCollections = objAction.ExecQuery("Select * from MicrosoftDNS_AType")
For each Collection in myCollections Wscript.Echo Collection.DomainName & ": " & Collection.OwnerName & ": " & Collection.IPAddress Next Set myCollections = Nothing Set objAction = Nothing
Depends on exactly what you are looking for after getting this far.
Deji
"Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:8672976B-B06D-4D00-9CE0-70307C62E3BC[ at ]microsoft.com...
[Quoted Text] > External of my script. I want to grab the information directly from Active > Directory and not reply on the output of some other function or program. > > "A, Deji" wrote: > >> what external tool? DNSCMD is the commandline DNS management interface >> for >> Windows. It's built-in and you can script it, too. >> >> Deji >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message >> news:CE4B00DE-25D7-4DB5-A704-E2A485C1B4FB[ at ]microsoft.com... >> >I wold like to determain this from the AD object, not be using the >> >external >> > tool dnscmd. >> > >> > Thanks >> > >> > "A, Deji" wrote: >> > >> >> dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A >> >> >> >> Deji >> >> >> >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message >> >> news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com... >> >> >I am querying DNS records in a zone, but would like to filter on A >> >> >records >> >> > only. Is there a way I can determaine this based on the AD attribtes >> >> > of >> >> > a >> >> > resource record? I can't seem to determaine what value holds this >> >> > information. I suspect dnsrecord but I'm nor sure what part relates >> >> > to >> >> > the >> >> > record type. >> >> > >> >> > Set objDNS = >> >> > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") >> >> > >> >> > >> >> > For Each objRecord in objDNS >> >> > wscript.echo objRecord.Get("dc") >> >> > Next >> >> >> >> >> >>
|
|
I see...
"Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message news:8672976B-B06D-4D00-9CE0-70307C62E3BC[ at ]microsoft.com...
[Quoted Text] > External of my script. I want to grab the information directly from Active > Directory and not reply on the output of some other function or program. > > "A, Deji" wrote: > >> what external tool? DNSCMD is the commandline DNS management interface >> for >> Windows. It's built-in and you can script it, too. >> >> Deji >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message >> news:CE4B00DE-25D7-4DB5-A704-E2A485C1B4FB[ at ]microsoft.com... >> >I wold like to determain this from the AD object, not be using the >> >external >> > tool dnscmd. >> > >> > Thanks >> > >> > "A, Deji" wrote: >> > >> >> dnscmd DNS-Server-Name /enumrecords myzone.TLD [ at ] /Type A >> >> >> >> Deji >> >> >> >> "Bob Smith" <BobSmith[ at ]discussions.microsoft.com> wrote in message >> >> news:1923FCEB-BCF8-4634-BEB6-481722CDB0F5[ at ]microsoft.com... >> >> >I am querying DNS records in a zone, but would like to filter on A >> >> >records >> >> > only. Is there a way I can determaine this based on the AD attribtes >> >> > of >> >> > a >> >> > resource record? I can't seem to determaine what value holds this >> >> > information. I suspect dnsrecord but I'm nor sure what part relates >> >> > to >> >> > the >> >> > record type. >> >> > >> >> > Set objDNS = >> >> > GetObject("LDAP://mydomain.com/DC=mytestzone.com,CN=MicrosoftDNS,DC=DomainDnsZones,DC=mydomain,DC=com") >> >> > >> >> > >> >> > For Each objRecord in objDNS >> >> > wscript.echo objRecord.Get("dc") >> >> > Next >> >> >> >> >> >>
|
|
|