September 2003
Intermediate to advanced
624 pages
15h 49m
English
You want to create a subnet.
Open the Active Directory Sites and Services snap-in.
Right-click on the Subnets container and select New Subnet.
Enter the Address and Mask and then select which site the subnet is part of.
Click OK.
Create an LDIF file called create_subnet.ldf with the following contents:
dn: cn=<Subnet>,cn=subnets,cn=sites,cn=configuration,<ForestRootDN> changetype: add objectclass: subnet siteObject: cn=<SiteName>,cn=sites,cn=configuration,<ForestRootDN>
then run the following command:
> ldifde -v -i -f create_subnet.ldf
' This code creates a subnet object and associates it with a site. ' ------ SCRIPT CONFIGURATION ------ strSubnet = "<Subnet>" ' e.g. 10.5.3.0/24 strSite = "<SiteName>" ' e.g. Dallas ' ------ END CONFIGURATION --------- set objRootDSE = GetObject("LDAP://RootDSE") set objSubnetsCont = GetObject("LDAP://cn=subnets,cn=sites," & _ objRootDSE.Get("configurationNamingContext") ) set objSubnet = objSubnetsCont.Create("subnet", "cn=" & strSubnet) objSubnet.Put "siteObject", "cn=" & strSite & ",cn=sites," & _ objRootDSE.Get("configurationNamingContext") objSubnet.SetInfo WScript.Echo "Successfully created subnet " & strSubnet
Subnet objects reside in the
Subnets container (e.g., cn=subnets,cn=sites,cn=configuration,dc=rallencorp,dc=com) in the CNC. The relative distinguished name (RDN) of the subnet should be the subnet address and bit-mask ...