Hello,
I'm tring to learn how to script and found this script online: It works fine and it creates the users but I would like the users to be enabled as well.
I know there is a command "objuser.acctdisabled = false"
but I don't know if thats the correct syntax or where to place it in the script so it only enables the accts I'm creating.
I appreciate the help.
********************
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 5
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "Train01" & i
objUser.AccountDisabled = FALSE
objLeaf.SetInfo
Next
WScript.Echo "5 Users created."
****************
I'm tring to learn how to script and found this script online: It works fine and it creates the users but I would like the users to be enabled as well.
I know there is a command "objuser.acctdisabled = false"
but I don't know if thats the correct syntax or where to place it in the script so it only enables the accts I'm creating.
I appreciate the help.
********************
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 5
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "Train01" & i
objUser.AccountDisabled = FALSE
objLeaf.SetInfo
Next
WScript.Echo "5 Users created."
****************