Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Windows 2003中创建用户_Windows_Windows Server 2003 - Fatal编程技术网

在Windows 2003中创建用户

在Windows 2003中创建用户,windows,windows-server-2003,Windows,Windows Server 2003,我需要一个脚本在Windows 2003中创建10个用户。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=U

我需要一个脚本在Windows 2003中创建10个用户。

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 

我很高兴知道你需要一个脚本来在Windows 2003中创建10个用户(建议阅读:)。sudo给我做了一个三明治。幸运的是,我们可以在上面发布我们的需求,代码猴子就会跳到。哦,等等。