Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to modify the location attribute in an existing subnet registered on AD sites

$
0
0

Could anyone help me to make an script to modify the location attribute in an existing subnet registered on AD sites and services.
Using the script to create subnet, like this one below, occurs error because the subnet already exist:

 Set objRootDSE = GetObject("LDAP://RootDSE")
  strConfigurationNC = objRootDSE.Get("configurationNamingContext")

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

  '-- Create Subnet --
  Set objSubnetsContainer = GetObject(strSubnetsContainer)

  Set objSubnet = objSubnetsContainer.***MODIFY/UPDATE***("subnet", strSubnetRDN)

  objSubnet.Put "siteObject", strSiteObjectDN
  objSubnet.Put "description", strDescription
  objSubnet.Put "location", strLocation
  objSubnet.SetInfo

Thanks,


Viewing all articles
Browse latest Browse all 15028

Trending Articles