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
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./x-tad-smaller>/color>Brent Westmoreland
-gil/x-tad-smaller>/color>
Gil Kirkpatrick/x-tad-smaller>/color>
CTO, NetPro/x-tad-smaller>/color>
Author of "Active Directory Programming"/x-tad-smaller>/color>
Don't miss the Directory Experts Conference/x-tad-smaller>/color>
March 21-24 Reston, VA/x-tad-smaller>/color>
April 25-28 Amsterdam, the Netherlands/x-tad-smaller>/color>
http://www.netpro.com/events/x-tad-smaller>/color>
-----Original Message-----/x-tad-smaller>/fontfamily>
From:/x-tad-smaller>/fontfamily> [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] /x-tad-smaller>On Behalf Of /x-tad-smaller>Brent Westmoreland/x-tad-smaller>/fontfamily>
Sent:/x-tad-smaller>/fontfamily> Thursday, March 11, 2004 12:19 PM/x-tad-smaller>/fontfamily>
To:/x-tad-smaller>/fontfamily> [EMAIL PROTECTED]/x-tad-smaller>/fontfamily>
Subject:/x-tad-smaller>/fontfamily> Re: [ActiveDir] VB Script/x-tad-smaller>/fontfamily>
<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. /fontfamily>
Any ideas/fontfamily>
Thanks/fontfamily>
Mark Hocraffer/fontfamily>
Rockwell Collins/fontfamily>
Brent Westmoreland/bigger>/fontfamily>
BMW Group - Data Center Americas /bigger>/fontfamily>
Business: 864.989.6567/bigger>/fontfamily>
BMW Group - Data Center Americas
Business: 864.989.6567/bigger>/fontfamily>