Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Making Home Folders as part of a domain for individual users login names.

Hi All, I have been recently creating user accounts for a primary School and although I have now created unique login details or all children in the School I have not setup their Home folders on the server. I have added the the profile paths but I have been warned the path has been created but the home directory must be created manually with the correct permissions. This in the past has not been too much of an issue as I have been able to do exactly what it asks manually for the relatively small amounts of new users I have created.

The down side is I  have created 250+ new user accounts and all have a unique char & num based login username. I would like to create an automated batch file that will create a folder (with the same name as the users login) in the students users area on the server with full permissions for everyone. I just don't know how to automate the creation of the folder using the domain login username without doing it manualy.

I have an excel file, CSV or TSV that can be imported for each class that has their username in a columb

Any help would be appreciated

Regards

James
0
edgeit
Asked:
edgeit
  • 2
2 Solutions
 
iedenCommented:
I would suggest My Document folder redirection. When enabled, the username directory is automatically created as the policy is deployed. Then you can use the path created \\server\share\%USERNAME% as the home directory.
0
 
conradieCommented:
In Excel, you could just create a column that has the word "md" in it next to the user name column. Repeat that all the way down the column. Then, create a third column that merges these two columns by adding them together with a space between.

See here for details on the merge of cells:

http://office.microsoft.com/en-us/excel-help/combine-the-contents-of-multiple-cells-HA010248390.aspx

Then take that third column and paste it into notepad, and save it it as a script, called usernames.cmd or something.

Test it out by running this script in a folder that is empty, and verify the results. Then, when its good and tested, run it in the folder you want to make the new user folders in.  
0
 
Adam BrownSr Solutions ArchitectCommented:
You can leverage the Quest Powershell Cmdlets for this. You'll need to install Powershell: http://support.microsoft.com/kb/968930
And the Quest Active Roles Powershell Cmdlets: http://www.quest.com/powershell/activeroles-server.aspx

Once those are installed, open the Quest Active Roles Management shell and the script to do it is pretty straightforward. Change to the directory where you want the folders created and run the attached commands.

It'll build a folder based on the users' account names, then assign each user as the owner of their folder. It will then assign full permissions to the user and the Administrators group.
get-qaduser | where {$_.accountisdisabled -eq $false} | foreach {$name = $_.samaccountname
md $name
icacls $name /setowner $name /T
icacls $name /grant :r $name:F /T
icacls $name /grant administrators:F /T
}

Open in new window

0
 
conradieCommented:
Acbrown, very nice solution. I'm going to have to take a look at that as well. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now