Create a text file like this one:
Blue,Kelly,bluek,04-6545645
Ben-Sachar,Ido,bensachari,03-7634545
Fluegel,Jay,fluegelj,03-9875765
Grande,Jon,grandej,02-6674534
Hankin,Alex,hankina,04-8856476
Jiang,George,jiangg,08-7636344
Kelly,Robert,kellyr,03-5568336
Kelly,Bob,kellyb,03-9567474
Li,Yuhong,liy,02-5462272
Moreland,Barbara,morelandb,04-88293922
Naik,Mandar,naikm,03-5531190
O'Donnell,Claire,odonnellc,03-5111930
Smith,John,smithj,03-8102201
Name the file USERS.TXT and place it in a directory.
Now open a CMD in that directory and run the following command:
for /F "eol=; tokens=1,2,* delims=," %%i in (users.txt) do dsadd user "cn=%%j %%i,ou=Test OU,dc=dpetri,dc=net" -samid %%k -upn %%k@dpetri.net -fn %%j -ln %%i -display "%%j %%i" -pwd P@ssw0rd -disabled yes
This will create user accounts with the names found in the USERS.TXT
==> HIer krijg ik de fout ==>the name provided is not a properly formed account name
Kan iemand me hierbij helpen? Mijn domeincontroller noemt example.com en de ou heet gewoon "test".
Zodus heb ik het gewoon zo aangepast:
for /F "eol=; tokens=1,2,* delims=," %%i in (users.txt) do dsadd user "cn=%%j %%i,ou=test,dc=example,dc=com" -samid %%k -upn %%k@example.com -fn %%j -ln %%i -display "%%j %%i" -pwd P@ssw0rd -disabled yes