Solved

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

Posted on 2010-11-18
4
246 Views
Last Modified: 2012-05-10
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
Comment
Question by:edgeit
  • 2
4 Comments
 
LVL 7

Expert Comment

by:ieden
ID: 34164694
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
 
LVL 9

Assisted Solution

by:conradie
conradie earned 100 total points
ID: 34165058
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
 
LVL 38

Accepted Solution

by:
Adam Brown earned 400 total points
ID: 34165298
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
 
LVL 9

Expert Comment

by:conradie
ID: 34165337
Acbrown, very nice solution. I'm going to have to take a look at that as well. :)
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Synchronize a new Active Directory domain with an existing Office 365 tenant
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now