我需要一个脚本来在Windows 2003中创建10个用户。
答案 0 :(得分:2)
VB脚本会起作用吗?
Option Explicit
Dim strUser
Dim objRootLDAP, objContainer, objNewUser
for count =0 to 9
strUser = "stackOUser" + count
Set objRootLDAP = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
objRootLDAP.Get("defaultNamingContext"))
' Build the actual User.
Set objNewUser = objContainer.Create("User", "cn=" & strUser)
objNewUser.Put "sAMAccountName", strUser
objNewUser.SetInfo
next
WScript.Quit