Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This is how I add new users to my Active Directory server:

  1. Setup the OU's, Groups, etc in AD GUI
  2. Create a batch file to create new users (dsmod)
  3. Run that .bat file
  4. Create a batch file to reset the individual passwords to something unique (admod)
  5. Run that .bat file

Now I want to add something to the workflow, which I do not know how:

  • Create individual folders in a Local Drive named after each user (e.g. d:\sAMAccount)
  • Assign those folders to each respective user in Active Directory
  • Automatically Map Network Drive when the users login (assuming their PC's are in the Domain)

What's the best way to go about this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

in your server side batch:

  • create the folder,
  • create a share with a sAMAccountName based naming convention,
  • assign a 'mount my home share' login script to the new account

    md d:\%sAMAccountName%

    net share home-%sAMAccountName%$=d:\sAMAccountName /GRANT:%sAMAccountName,FULL /REMARK:"Home-Folder for %sAMAccountName%"

    dsquery user -samid %sAMAccountName% | dsmod user -loscr "\SomeDC\NETLOGON\mapHome.cmd"

the 'mapHome' script is the same script for all affected users it just contains:

net use h: \\FileServer\home-%USERNAME%$
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.