Batch file?

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Is there a way for me to create a home directory for all
of my users in an OU via a batch file? What is the
command line utility and how would I assign it only to
users of a particluar OU? I realize I could shift+select
the users and do it that way but I'd like something a bit
more flexible.
Thanks,
Dan
 
Is there a way for me to create a home directory for all
of my users in an OU via a batch file? What is the
command line utility and how would I assign it only to
users of a particluar OU? I realize I could shift+select
the users and do it that way but I'd like something a bit
more flexible.
Thanks,
Dan

Using the Active Directory command-line tools, tip 6820 in the 'Tips & Tricks'
at http://www.jsiinc.com, you can.

dsquery user OU=OUNAME,DC=JSIINC,DC=COM|dsmod user -hmdir
\\JSI001\Users\$username$ -hmdrv H:

The above is 1 line

The dsquery user gets the distinguished name of all users in the specified OU
and pipes it to the dsmod user command where the $username$ string is
automatically replaced with the sAMAccountName (SAMID)


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top