K
KD
Thank you so much for the previous post. It worked great.
One more question if you have any suggestion. From the
below script it adds the computer accounts to the Parent
Domain. Do you know the switches to add these to a child
domain? When I change the 1st line
to "LDAP://DC=my,DC=domain,DC=com") it does not work.
Set objRootDSE = GetObject ("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://ou=Test," & _
objRootDSE.Get("defaultNamingContext"))
ibaselen = 4
For i = 1 To 20
t = ""
if len(i) < ibaselen then
t = i
for z= 1 to (ibaselen-len(i) )
t = "0" & t
Next
End if
Set objLeaf = objContainer.Create
("Computer", "cn=Computer-" & t)
objLeaf.Put "sAMAccountName", "Computer-" & t
objLeaf.SetInfo
Next
WScript.Echo "20 Computers Created."
One more question if you have any suggestion. From the
below script it adds the computer accounts to the Parent
Domain. Do you know the switches to add these to a child
domain? When I change the 1st line
to "LDAP://DC=my,DC=domain,DC=com") it does not work.
Set objRootDSE = GetObject ("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://ou=Test," & _
objRootDSE.Get("defaultNamingContext"))
ibaselen = 4
For i = 1 To 20
t = ""
if len(i) < ibaselen then
t = i
for z= 1 to (ibaselen-len(i) )
t = "0" & t
Next
End if
Set objLeaf = objContainer.Create
("Computer", "cn=Computer-" & t)
objLeaf.Put "sAMAccountName", "Computer-" & t
objLeaf.SetInfo
Next
WScript.Echo "20 Computers Created."