DNS Server List

  • Thread starter Thread starter Scott L. Dukart
  • Start date Start date
S

Scott L. Dukart

I am looking to identify all Windows 2000 Servers that have the Domain Name
System (DNS) Networking Componenet installed on my network. Is there a way
to do this or a utility that can accomplish that?

Thank you in advance.
 
This will loop through your Domain looking for computers running DNS. I use
WMI, which may be slower than just shelling out doing something like
srvinfo. But it works for me

'''''''''''''''''''''''''''''''BEGIN''''''''''''''''''''''''''''''''
Const ADS_SCOPE_SUBTREE = 2

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select Name, Location from 'LDAP://DC=Mydomain,DC=com"_
& "where objectClass='computer'"
'If you want to do the query in a Child Domain, then replace
'LDAP://DC=Mydomain,DC=com" with
'LDAP://DC=myChildDomain,DC=Mydomain,DC=com"

objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF

ComputerName = objRecordSet.Fields("Name").Value
Call DoEnum(ComputerName)
objRecordSet.MoveNext

Loop
Set objRecordSet = Nothing
Set objCommand = Nothing
Set objConnection = Nothing


Sub DoEnum(ComputerName)
On Error Resume Next
strComputer = ComputerName

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colListOfServices
If instr(UCASE(objService.DisplayName), UCASE("DNS Server")) >0 Then
Wscript.Echo(objService.SystemName) & " is running " &
objService.DisplayName & ". The Service is " & objService.State
End If
Next

End Sub

'''''''''''''''''''''''''''''''END''''''''''''''''''''''''''''''''

HTH
--
Sincerely,

Dèjì Akómöláfé, MCSE MCSA MCP+I
www.akomolafe.com
www.iyaburo.com
Do you now realize that Today is the Tomorrow you were worried about
Yesterday? -anon
 
In
Scott L. Dukart said:
I am looking to identify all Windows 2000 Servers that have the
Domain Name System (DNS) Networking Componenet installed on my
network. Is there a way to do this or a utility that can accomplish
that?

Thank you in advance.

Not sure about what to script for to search each machine, but you can use a
network scanner to scan port 53 on each machine to see which ones are
running the service and that are actually up and running responding to
clients.

If I may ask, what are you trying to find out?


--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS IS" with no warranties.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory
 
I am trying to identify all servers that are running DNS (I think that too
many DNS servers exist on the network). We have over 500 servers across
many states and I am trying to construct a solution for DNS.

"Ace Fekay [MVP]"
 
In
Scott L. Dukart said:
I am trying to identify all servers that are running DNS (I think
that too many DNS servers exist on the network). We have over 500
servers across many states and I am trying to construct a solution
for DNS.
Hmm, quite a bit of servers there. That script that Deji posted seems like a
nice one for your solution.
:-)


--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS IS" with no warranties.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory
 
I am trying to put togther a topology of all DNS servers in my network. The
servers cover several states and several hundred are in production.

"Ace Fekay [MVP]"
 
In
Scott L. Dukart said:
I am trying to put togther a topology of all DNS servers in my
network. The servers cover several states and several hundred are in
production.

Ok. That script that Deji posted seems like it will do the trick. Otherwise,
you can use something like Visio 2000 or newer to pull your whole
infrastructure in and will give you a professional output.

--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS IS" with no warranties.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory
 
Back
Top