-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Crenshaw, Jason
Sent: Wednesday, July 23, 2003 9:40 AM
To: '[EMAIL PROTECTED]'
Subject: [ActiveDir] Active Directory SubnetsI 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
Title: Message
Pretty
much that is it. You can translate it to different languages but you have three
main options
1.
ADSI Commands such as below
2.
Pure LDAP API Commands
3. GUI
or scripting the GUI via something like WinBatch or scriptit though I wouldn't
really recommend
In our
environment I use perl scripts that make adsi calls.
- [ActiveDir] Active Directory Subnets Crenshaw, Jason
- RE: [ActiveDir] Active Directory Subnets Joe
- RE: [ActiveDir] Active Directory Subnets Ken Cornetet
- RE: [ActiveDir] Active Directory Subnets Fuller, Stuart
- RE: [ActiveDir] Active Directory Subnets Gil Kirkpatrick
