<Quick and dirty> prints out all of the subnets in the domain and their associated site.<Quick and Dirty>

Adapted from Robbie Allen's Active Directory Cookbook by O'Rielly Press


set objRootDSE = GetObject("LDAP://RootDSE")
set objSubnetsCont = GetObject("LDAP://cn=subnets,cn=sites," & _
objRootDSE.Get("configurationNamingContext") )
objSubnetsCont.Filter = Array("subnet")
for each objSubnet in objSubnetsCont
Wscript.Echo " " & objSubnet.Get("cn")& ";" & objSubnet.Get("SiteObject")
next

On Mar 11, 2004, at 1:55 PM, <[EMAIL PROTECTED]> wrote:

<x-tad-smaller>Using VBS and Active Directory, given an ip address, I want to be able to tell what site that ip address is associated with. �I have looked at the iadsTools but not found anything for easily doing that and have checked the Script Center for something like that. �I can read the subnets out of AD and attempt to parse thru it but there has to be an easier way to do this. �</x-tad-smaller>

<x-tad-smaller>Any ideas</x-tad-smaller>

<x-tad-smaller>Thanks</x-tad-smaller>

<x-tad-smaller>Mark Hocraffer</x-tad-smaller>
<x-tad-smaller>Rockwell Collins</x-tad-smaller>

Brent Westmoreland
BMW Group - Data Center Americas
Business: 864.989.6567

Reply via email to