Add AD Subnet Script - Error: Constraint Violation 8007202F
I'm relatively new to scripting and I need help with a script I got from the
Repository. I need to create 150 AD subnets and would like to script it
auto-magically. The script is
strSubnetRDN = "cn=172.18.0.96/27"
strSiteObjectRDN = "cn=Loc"
strDescription = "LocDescription"
strLocation = "LocLocation"
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
It fails with Line: 19 Char: 1 Error: A Constraint Violation occurred Code:
8007202F Source: Null
Research of this error indicates a permissions error but I am running this
as Ent Admin. What am I missing?
|