Title: Message
Try DsAddressToSiteNames() from the platform SDK.
 
-gil
 
Gil Kirkpatrick
CTO, NetPro
Author of "Active Directory Programming"
 
Don't miss the Directory Experts Conference
March 21-24 Reston, VA
April 25-28 Amsterdam, the Netherlands
http://www.netpro.com/events
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brent Westmoreland
Sent: Thursday, March 11, 2004 12:19 PM
To: [EMAIL PROTECTED]
Subject: Re: [ActiveDir] VB Script

<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:



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.  


Any ideas


Thanks


Mark Hocraffer

Rockwell Collins


Brent Westmoreland

BMW Group - Data Center Americas

Business: 864.989.6567

Reply via email to