I tested and corrected every single one of those scripts before publication, 
but the editor only included about ½ the corrections. Sorry about that. That 
one should read:

strNewSiteName = "<SiteName>" ' e.g. "Raleigh"
strSubnetName = "<SubnetName>" ' e.g. "192.168.1.0\/24"

Set objRootDSE = GetObject("LDAP://RootDSE")
Set objSiteSettings = GetObject("LDAP://cn=" & _
        strSubnetName & _
        ",cn=subnets,cn=sites," & _
        objRootDSE.Get("ConfigurationNamingContext"))

objSiteSettings.Put "siteObject", _
        "cn=" & strNewSiteName & ",cn=sites," & _
        objRootDSE.Get("ConfigurationNamingContext")
objSiteSettings.SetInfo
WScript.Echo("Site Membership updated successfully!")

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Christopher Bodnar [mailto:[email protected]]
Sent: Thursday, April 15, 2010 3:07 PM
To: NT System Admin Issues
Subject: modifying subnet assignment by script

I got this from the AD Cookbook and it's giving me an error. Can someone test 
this and let me know if it works for them in a test environment? The site and 
subnet must exist for this to work. I'm getting the following error:

(5, 49) Microsoft VBScript compilation error: Invalid character

Which corresponds to the "_" in front of "_strSubnetName". I've tried it 
without the "_" and get a null error.


'*************************Begin 
Script***************************************************
strNewSiteName = "TESTSite1" ' e.g. "Raleigh"
strSubnetName = "10.170.2.0/24" ' e.g. "192.168.1.0/24"

Set objRootDSE = GetObject("LDAP://RootDSE")
Set objSiteSettings = GetObject("LDAP://cn=" & _strSubnetName & _
        "cn=subnets,cn=sites," & _
        objRootDSE.Get("ConfigurationNamingContext"))

objSiteSettings.Put "siteObject", _
        "cn=" & strNewSiteName & ",cn=sites," & _
        objRootDSE.Get("ConfigurationNamingContext")
objSiteSettings.SetInfo
WScript.Echo("Site Membership updated successfully!")
'*************************End 
Script***************************************************


Not sure what the issue is here.

Thanks,


Chris Bodnar, MCSE
Systems Engineer
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]<mailto:[email protected]>
Phone: 610-807-6459
Fax: 610-807-6003 ----------------------------------------- This message, and 
any attachments to it, may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law. If the reader of 
this message is not the intended recipient, you are notified that any use, 
dissemination, distribution, copying, or communication of this message is 
strictly prohibited. If you have received this message in error, please notify 
the sender immediately by return e-mail and delete the message and any 
attachments. Thank you.





~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to