K
KD
I want to create several computer accounts called
Computer-0001 through Computer-1000.
Here is a sample VBS Script that works but does not
include the 0's which I want to incorporate. The script
only creates Computer-1 instead of Computer-0001. Anyone
have any suggestions? Thanks!!!
Set objRootDSE = GetObject ("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://ou=Test," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 20
Set objLeaf = objContainer.Create
("Computer", "cn=Computer-" & i)
objLeaf.Put "sAMAccountName", "Computer-" & i
objLeaf.SetInfo
Next
WScript.Echo "20 Computers Created."
Computer-0001 through Computer-1000.
Here is a sample VBS Script that works but does not
include the 0's which I want to incorporate. The script
only creates Computer-1 instead of Computer-0001. Anyone
have any suggestions? Thanks!!!
Set objRootDSE = GetObject ("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://ou=Test," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 20
Set objLeaf = objContainer.Create
("Computer", "cn=Computer-" & i)
objLeaf.Put "sAMAccountName", "Computer-" & i
objLeaf.SetInfo
Next
WScript.Echo "20 Computers Created."