Title: Message
Robbie Allen at Cisco put together a really cool system where they download their router configuration every night into a database and then populate the AD subnet objects from that, completely hands off. He talked about it at the last year's Directory Experts conference in Scottsdale. His new book has some sample scripts for doing this as well.
 
-gil
 
Gil Kirkpatrick
CTO, NetPro
-----Original Message-----
From: Crenshaw, Jason [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 6:40 AM
To: '[EMAIL PROTECTED]'
Subject: [ActiveDir] Active Directory Subnets

I have a question about AD Subnets and programmatically adding them to Sites.  We have a rather large list of subnets that need to be assigned to Sites and I didn't want to hand-to-hand combat those entries if possible.

I was looking at using this script I found at Microsoft, but was wondering what some other AD sites have done in the past.  Or maybe someone has a better suggestion than the script below.

Thanks,

Jason

Creating an Active Directory Subnet

Description
Creates an Active Directory subnet.

Script Code

strSubnetRDN     = "cn=192.168.1.0/26"

strSiteObjectRDN = "cn=Ga-Atl-Sales"

strDescription   = "192.168.1.0/255.255.255.192"

strLocation      = "USA/GA/Atlanta"

Set objRootDSE = GetObject("LDAP://RootDSE")

strConfigurationNC = objRootDSE.Get("configurationNamingContext")

strSiteObjectDN = strSiteObjectRDN & ",cn=Sites," & strConfigurationNC

strSubnetsContainer = "LDAP://cn=Subnets,cn=Sites," & strConfigurationNC

Set objSubnetsContainer = GetObject(strSubnetsContainer)

Set objSubnet = objSubnetsContainer.Create("subnet", strSubnetRDN)

objSubnet.Put "siteObject",  strSiteObjectDN

objSubnet.Put "description", strDescription

objSubnet.Put "location",    strLocation

objSubnet.SetInfo      

Reply via email to