Glenn said:
can someone please explain how to use dsmod to create passwords through a
batch file? I read about someone doing it in another post, but can't find
any info on how to do it.
Do you know how to change ONE password using DSMod?
DSMod user /?
Here's the help's example for chaning a password:
dsmod user "CN=John Doe,CN=Users,DC=domain,DC=com" -pwd A1b2C3d4 -mustchpwd
yes
If you can do that you can use the "For /f " command to parse and
pump in a text file with each set of parameters in a text file.
Here's an example of pulling in (the first 4) parameters from each
line of a text file:
for /f "tokens=1-3" %a in (t.txt) do @echo %a-%b-%c
(t.txt == an arbitrary file name with YOUR date)
This just echo's out the parameters (or tokens) but you can use
this pattern to drive a "dsmod" command.
for /? will give you help on using the for ... in (...) do ... command
Also note you might need to use "quotes" around the tokens in the
file OR in the command if you have multi-word parameters, or in
the file you might wish to use a different "token delimiter" like ":"
in the file and quotes in the command line like the dsmod sample
does.
[following is all on one line ]
for /f "tokens=1-3" %a in (t.txt) do dsmod user "CN=%a
%b,CN=Users,DC=domain,DC=com" -pwd %d -mustchpwd yes
If you drive this from a file called "t.txt" that includes something like:
John Doe A1b2C3d4
Sally Roe B9b8D3d4
Fred Smith C7b6E3d4
(Of course you can play around with adding in the OU
instead of using the "Users" container too.)