我正在尝试将批量用户添加到AD服务器,为此我使用的是 dsadd.exe
我正在使用批处理文件调用该命令,并且所有信息都存在于csv文件中
命令:
for /F "tokens=1,2,3,4 delims=," %%i in (Users.csv) do dsadd user "cn=%%j %%i,cn=Users,DC=test,DC=com" -samid %%k -pwd "%%l" -upn %%k@test.com -fn "%%j" -ln "%%i" -display "%%j %%i" -disabled no -mustchpwd yes -hmdrv U: -hmdir "C:\%%k"
Users.csv 拥有以下格式的所有用户信息:
Last Name First Name Username Password
LastName1 FirstName1 user1 Password1
LastName2 FirstName2 user2 Password2
LastName3 FirstName3 user3 Password3
LastName4 FirstName4 user4 Password4
LastName5 FirstName5 user5 Password5
LastName6 FirstName6 user6 Password6
LastName7 FirstName7 user7 Password7
LastName8 FirstName8 user8 Password8
LastName9 FirstName9 user9 Password9
LastName10 FirstName10 user10 Password10
LastName11 FirstName11 user11 Password11
LastName12 FirstName12 user12 Password12
LastName13 FirstName13 user13 Password13
LastName14 FirstName14 user14 Password14
LastName15 FirstName15 user15 Password15
LastName16 FirstName16 user16 Password16
LastName17 FirstName17 user17 Password17
LastName18 FirstName18 user18 Password18
LastName19 FirstName19 user19 Password19
LastName20 FirstName20 user20 Password20
等等......直到5000个用户
我无法添加所有用户,只是在添加少量用户后就会挂起,而且这个数字会有所不同,有时候jua会添加一个用户,有时会增加100个用户。
可能是什么问题?请帮忙。