开发者

Creating users in Windows 2003 [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 y开发者_运维百科ears ago.

I need a script to create 10 users in Windows 2003.


Will VB script work?

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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜