Question QUESTION: Hi , I contacted you yesterday with a problem with subnets and sorry it was my mistake the script was not working. So I have another script which creates subnets from a text documest, assigns them to the same site and puts the same description. Here is the script :
On Error Resume Next
Const ADS_SCOPE_SUBTREE = 2
Const FOR_APPENDING = 8
Const FOR_READING = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Admin\script for creating subnets\brso01_colombia_1stwave.txt", FOR_READING)
This script is working for shure.
Can you please help me with this script because I want to change it just to assign subnets from the listg to another site, not to create them.
Thank you very very much!
ANSWER: Hi Raducu,
I need some information from you.
What your brso01_colombia_1stwave.txt file contains. I mean each line has single subnet masks? (Yes/No).
If Yes then you dont need to split your single line value and not needed For Loop.
If you have still problem then please email a single line in your txt file.
Regards
Subbu.
---------- FOLLOW-UP ----------
QUESTION: The file contains a subnet on each line, with no header, like this:
10.123.124.0/24
10.145.213.0/24
and so on...
This script I use for creating subnets and it works very fine but I want to modify the script to only assign the subnets from the file ( the subnets are already created in Active Directory) to another site.
The site is contained here
strSiteObjectRDN = "cn=brso01"
I think yhis is the part that needs to be modified:
Set objSubnetsContainer = GetObject(strSubnetsContainer)
Set objSubnet = objSubnetsContainer.Create("subnet", "cn="&arrServiceList(i))
objSubnet.Put "siteObject", strSiteObjectDN
objSubnet.Put "description", strDescription
As I can see, after creating the object the script edits the attributes ( siteObject and description), but I want just to edit the site attribute of the subnets in the .txt file.
Thank you very much!
Answer You dont need to split the line with ",". Actually there is no "," in that line.
You just need
Set objSubnet = objSubnetsContainer.Create("subnet", "cn="&strNextLine) 'here strNextLine variable has 10.123.124.0/24
This variable value will keep on change till end of file.
I just modified your code, try this and let me know.