I was able to create and successfully add 100 users via addusers.exe but there were two snags. Most everything worked as expected but the home directories were not created.
1) Using the Computer Management/Local Users and Group/Users application: The "Local path" on the Profile tab was correct, it just didn't create the directory. If I individually select an account, click on the Profile tab and click the OK button then the directory will be created. Obviously doing that a hundred times defeats the purpose of being able to create scripts, but what is the problem?
Comment: The documentation that came on the Windows 2000 Server Resource Kit incorrectly documents the addusers.exe specification for the "[User]" section of the input file. It shows "HomeDriveAndPath" as being the fifth argument but is should be the sixth given:
[User]
Username,FullName,Password,Comment,HomeDriveAndPath,Profile,Script,
should be:
[User]
Username,FullName,Password,Comment,???,HomeDriveAndPath,Profile,Script
2) I confirmed this via the "addusers /d filename" command and examining the results. Does anyone know what the parameter represented by the "???" should be?
<UPDATE> The correct syntax for the [User] section is:
[User]
Username,Fullname,Password,Comment,HomeDrive,HomePath,Profile,Script
Note: This is not documented that I could find. If you specify both HomeDrive and HomePath, it will try to map that drive to the HomePath. If you give a HomePath and don't specify a HomeDrive, it will use the HomePath as the local path for the home directory. The label "ConnectAsDrive" would probably have been more descriptive than what the documented "HomeDrive".
Corrected documentation can be found under "Microsoft Knowledge Base Article - 199878" at:
http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b199878
Even after these corrections, my original problem described in 1) still occurs.
</UPDATE>
Here is an example of my script. Maybe I've overlooked something:
[User]
user001,,xyzzy,,,E:\home\user001,,
[Global]
[Local]
Users,,BOXNAME\user001,
Special,,BOXNAME\user001,
Comment: The arguments (if used in the order listed) will not work if you use "/p:". E.g.:
addusers /c /p:c /p:e filename
will return an error:
Error: filename parameter required immediately after (/c|/d|/e)
however:
addusers /c filename /p:c /p:e
is accepted.
<UPDATE> The following is excerpted from UPDATE link above:
AddUsers {/c|/d{:u}|/e} filename [/s:x] [/?] [\\computername|domainname] [/p:{l|c|e|d}]
</UPDATE>
Thanks in advance, --Jim
by: oBdAPosted on 2003-01-28 at 13:29:24ID: 7832934
Hi Jim,
(I hope it's till of use for you, but I only just registered.)
AddUsers.exe is a very useful tool, but it does *not* (and never has) automatically create the home directories (neither do ldifde.exe or csvde.exe, btw.), so you'll have to create the according directories in a command script, for example, and, while you're at it, afterwards use cacls.exe to adjust the NTFS rights.
As for the home directories, since you probably don't want to retype them all, you could either extract their names out of your user file using "for /f ..." or, if your usernames do indeed follow the user001, user002, ... pattern, in a loop with set /a.
You don't need to specify the Servername when adding users to a local group, btw. That is specified by the \\computername.
Hope this helps,
oBdA