Too late!  :o)
 
To do the API call from vbscript you will have to look at something like DynaCall or have someone wrap the API call up for you like iadstools does for some of the calls. You can look at the dynacall info here - http://www.borncity.com/WSHBazaar/WSHDynaCall.htm
 
If you want to do this natively in vbscript you would want to read the config container and build up some form of btree data structure that you could wander through to find best fit. Note that if you know your subnet structure you are using and you know you don't have nested subnets for sites you could probably simply it to a simple table or hash versus using a full blown btree.
 
-------------
http://www.joeware.net   (download joeware)
http://www.cafeshops.com/joewarenet  (wear joeware)
 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brent Westmoreland
Sent: Thursday, March 11, 2004 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [ActiveDir] VB Script

yeah,

that sounds much better is there a remove post button somewhere?


On Mar 11, 2004, at 2:29 PM, Gil Kirkpatrick wrote:

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

Brent Westmoreland
BMW Group - Data Center Americas
Business: 864.989.6567

Reply via email to