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
注意保存后,更改一下dc名称(红色字体),如果ou名称是英文,也可以连ou名称一起更改,这样就可以直接将用户建立到ou里面。
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
网友评论