Contact Info

Crumbtrail » Administration » Scripts » VBScript » Custom script

Create an Active Directory Subnet

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.


strSubnetRDN     = "cn="
strSiteObjectRDN = "cn=Ga-Atl-Sales"
strDescription   = ""
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