hi there, is there any tools (freeware preferred, win32 preferred but linux also ok) to check how many DHCP servers in a particular lan segment, & their corresponding ipaddr?
You can query AD. This code sniffs ALL DHCP servers in AD and parses the output. From there, you can visually identify those DHCP server on a particular network segment.
set objCont = GetObject("LDAP://CN=DhcpRoot,CN=NetServices,CN=Services,CN=Configuration," & strDomainName)
set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile(strFileName, 2, true)
set objShell = WScript.CreateObject("WScript.Shell")
colDHCPServers = objCont.GetEx("dhcpServers")
for each strDHCPServer in colDHCPServers
strIP = mid(strDHCPServer, 2, inStr(strDHCPServer, "$") - 2)
strServerName = right(strDHCPServer, len(strDHCPServer) - inStr(strDHCPServer, "="))
strServerName = left(strServerName, inStr(strServerName, ".") - 1)
objFile.Write strServerName & ": " & strIP & vbNewLine
next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.