Is there a way to add home folders for about 1000 users all at once? I've
looked at ldifde but can't quite figure out how to do this.
TIA
BJ
If you have a Windows XP desktop, you can use DSMOD:
See tip 6820 in the 'Tips & Tricks' at
http://www.jsiinc.com
C:>dsmod user /?
Description: Modifies an existing user in the directory.
Syntax: dsmod user <UserDN ...> [-upn <UPN>] [-fn
<FirstName>]
[-mi <Initial>] [-ln <LastName>]
[-display <DisplayName>]
[-empid <EmployeeID>] [-pwd
{<Password> | *}]
[-desc <Description>] [-office
<Office>] [-tel <Phone#>]
[-email <Email>] [-hometel
<HomePhone#>] [-pager <Pager#>]
[-mobile <CellPhone#>] [-fax <Fax#>]
[-iptel <IPPhone#>]
[-webpg <WebPage>] [-title <Title>]
[-dept <Department>]
[-company <Company>] [-mgr <Manager>]
[-hmdir <HomeDir>]
[-hmdrv <DriveLtr>:] [-profile
<ProfilePath>]
[-loscr <ScriptPath>] [-mustchpwd {yes |
no}]
[-canchpwd {yes | no}] [-reversiblepwd {yes | no}]
[-pwdneverexpires {yes | no}]
[-acctexpires <NumDays>] [-disabled {yes |
no}]
[{-s <Server> | -d <Domain>}] [-u
<UserName>]
[-p {<Password> | *}] [-c] [-q] [{-uc | -uco
| -uci}]
Parameters:
Value Description
<UserDN ...> Required/stdin. Distinguished names
(DNs)
of one or more users to modify.
If target objects are omitted they
will be taken from standard input
(stdin)
to support piping of output from
another command
to input of this command.
-upn <UPN> Sets the UPN value to <UPN>.
-fn <FirstName> Sets user first name to <FirstName>.
-mi <Initial> Sets user middle initial to <Initial>.
-ln <LastName> Sets user last name to <LastName>.
-display <DisplayName> Sets user display name to
<DisplayName>.
-empid <EmployeeID> Sets user employee ID to <EmployeeID>.
-pwd {<Password> | *} Resets user password to <Password>. If
*, then
you are prompted for a password.
-desc <Description> Sets user description to
<Description>.
-office <Office> Sets user office location to <Office>.
-tel <Phone#> Sets user telephone# to <Phone#>.
-email <Email> Sets user e-mail address to <Email>.
-hometel <HomePhone#> Sets user home phone# to <HomePhone#>.
-pager <Pager#> Sets user pager# to <Pager#>.
-mobile <CellPhone#> Sets user mobile# to <CellPhone#>.
-fax <Fax#> Sets user fax# to <Fax#>.
-iptel <IPPhone#> Sets user IP phone# to <IPPhone#>.
-webpg <WebPage> Sets user web page URL to <WebPage>.
-title <Title> Sets user title to <Title>.
-dept <Department> Sets user department to <Department>.
-company <Company> Sets user company info to <Company>.
-mgr <Manager> Sets user's manager to <Manager>.
-hmdir <HomeDir> Sets user home directory to <HomeDir>.
If this is
UNC path, then a drive letter to be
mapped to
this path must also be specified
through -hmdrv.
-hmdrv <DriveLtr>: Sets user home drive letter to
<DriveLtr>:
-profile <ProfilePath> Sets user's profile path to
<ProfilePath>.
-loscr <ScriptPath> Sets user's logon script path to
<ScriptPath>.
-mustchpwd {yes | no} Sets whether the user must change his
password (yes)
or not (no) at his next logon.
-canchpwd {yes | no} Sets whether the user can change his
password (yes)
or not (no). This setting should be
"yes"
if the -mustchpwd setting is "yes".
-reversiblepwd {yes | no}
Sets whether the user password should
be stored using
reversible encryption (yes) or not
(no).
-pwdneverexpires {yes | no}
Sets whether the user's password never
expires (yes)
or not (no).
-acctexpires <NumDays> Sets user account to expire in
<NumDays> days from
today. A value of 0 sets expiration at
the end of
today.
A positive value sets expiration in
the future.
A negative value sets expiration in
the past.
A string value of "never" sets the
account
to never expire.
-disabled {yes | no} Sets whether the user account is
disabled (yes)
or not (no).
{-s <Server> | -d <Domain>}
-s <Server> connects to the
domain controller (DC)
with name <Server>.
-d <Domain> connects to a DC in
domain <Domain>.
Default: a DC in the logon domain.
-u <UserName> Connect as <UserName>. Default: the
logged in user.
User name can be: user name,
domainuser name,
or user principal name (UPN).
-p <Password> Password for the user <UserName>. If *
then prompt
for password.
-c Continuous operation mode. Reports
errors but
continues with next object in argument
list
when multiple target objects are
specified.
Without this option, the command exits
on the
first error.
-q Quiet mode: suppress all output to
standard output.
{-uc | -uco | -uci} -uc Specifies that input from or
output to pipe is
formatted in Unicode.
-uco Specifies that output to pipe or
file is
formatted in Unicode.
-uci Specifies that input from pipe or
file is
formatted in Unicode.
Remarks:
If a value that you supply contains spaces, use quotation
marks
around the text (for example, "CN=John
Smith,CN=Users,DC=microsoft,DC=com").
If you enter multiple values, the values must be separated by
spaces
(for example, a list of distinguished names).
The special token $username$ (case insensitive) may be used to
place the
SAM account name in the value of -webpg, -profile, -hmdir, and
-email parameter.
For example, if the target user DN is
CN=Jane Doe,CN=users,CN=microsoft,CN=com and the SAM account
name
attribute is "janed," the -hmdir parameter can have the
following
substitution:
-hmdir users$username$home
The value of the -hmdir parameter is modified to the following
value:
- hmdir usersjanedhome
Examples:
To reset a user's password:
dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
-pwd A1b2C3d4 -mustchpwd yes
To reset multiple user passwords to a common password
and force them to change their passwords the next time they
logon:
dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
"CN=Jane Doe,CN=Users,DC=microsoft,DC=com" -pwd A1b2C3d4
-mustchpwd yes
To disable multiple user accounts at the same time:
dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
"CN=Jane Doe,CN=Users,DC=microsoft,DC=com" -disabled yes
To modify the profile path of multiple users to a common path
using the
$username$ token:
dsmod user "CN=John Doe,CN=Users,DC=microsoft,DC=com"
"CN=Jane Doe,CN=Users,DC=microsoft,DC=com" -profile
users$username$profile
See also:
dsmod computer /? - help for modifying an existing computer in
the directory.
dsmod contact /? - help for modifying an existing contact in
the directory.
dsmod group /? - help for modifying an existing group in the
directory.
dsmod ou /? - help for modifying an existing ou in the
directory.
dsmod server /? - help for modifying an existing domain
controller in the
directory.
dsmod user /? - help for modifying an existing user in the
directory.
dsmod quota /? - help for modifying an existing quota
specification in the
directory
dsmod partition /? - help for modifying an existing partition
in the
directory
Directory Service command-line tools help:
dsadd /? - help for adding objects.
dsget /? - help for displaying objects.
dsmod /? - help for modifying objects.
dsmove /? - help for moving objects.
dsquery /? - help for finding objects matching search
criteria.
dsrm /? - help for deleting objects.
dsmod failed:The parameter is incorrect.
type dsmod /? for help.
C:>
Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com