How to add domain users in batch in vbs
This article mainly shows you "how to mass add domain users in vbs", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to achieve batch add domain users in vbs" this article.
The code is as follows:
Set adsou=getobject ("ldap://cn=users,dc=hzcncter,dc=local") const forreading = 1 set objfso = createobject ("scripting.filesystemobject") set objtextfile = objfso.opentextfile _ ("users.txt", forreading) do until objtextfile.atendofstream strnextline = objtextfile.readline arruserlist = split (strnextline, ",") struser=arruserlist (0) strpass=arruserlist (1) set adsuser=adsou.create ("user", "cn=" & struser) adsuser.put "samaccountname", struser adsuser.put "userprincipalname", struser & "@ hzcncter.local" adsuser.setinfo adsuser.setpassword strpass adsuser.accountdisabled=false adsuser.setinfo loop
Note that after saving, change the dc name (red font), if the ou name is English, you can also change the ou name, so you can directly establish the user into the ou inside.
The above is all the content of the article "how to add domain users in bulk in vbs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!