Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating home directory after user creation with csvde

Posted on 2012-04-11
3
Medium Priority
?
1,317 Views
Last Modified: 2012-04-19
Hi

I want to create a lot of users by csvde. I use a script that export the information from a database, create all the users using csvde and set the initial passwords for the users using admod.

But even if csvde can set the home directory attribute of the user, it does not actually create the home folder. This is described in the answer to this question:

http://www.experts-exchange.com/OS/Miscellaneous/Q_21585832.html

Is there someone that can suggest how to make a batch script that can create these home folders? I assume it is not enouch to just create them, I would also need to set permissions correctly. (?)

I use Windows Server 2008 R2

Lars Olav Tveito
0
Comment
Question by:lotveito
  • 2
3 Comments
 
LVL 24

Assisted Solution

by:Mike Thomas
Mike Thomas earned 1000 total points
ID: 37836848
When you right click a user and manually set the home drive path it creates the folder for you with the correct permissions on the share you have specified so you could simply go into an OU select ALL the users in that OU using CTRL+A, right click then select properties then select profile, tick home drive, set the letter then set the path using the %username% variable.

This should take maybe 10 seconds for each each OU you have users in.......not an ideal solution but if you have a small number of OU's might be the quickest solution......but not automated.
0
 

Accepted Solution

by:
lotveito earned 0 total points
ID: 37846715
Thank you MojoTech for your suggestion. Yes, if this was a one time import, this would be the quickest and easiest solution. For this I will give you credit. The thing is that while the initial import will be a one time thing with a gazillion users, new users will also be added regularily. My plan is that when these are added by administrative personell to the employee-database, my scripts would automatically pick up this, and add them as users in Active Directory. The glory of this greatly diminishes if someone with Admin-rights on the domain controller needs to log on and do someting each time someone have been added to the database in the personell office.

I have done some googling and found my own solution. It was easier than I thought:

wget -O C:\uimp\foldercreatelist.txt http://10.30.0.15/userimp/foldercreatelist.txt

FOR /F %%E IN (C:\uimp\foldercreatelist.txt) DO (
mkdir \\siloen\Home\%%E
)

Open in new window


The file foldercreatelist.txt is generated by the personell database, and contains one username per line. My script first picks it from the database server (using wget - which I had to install) and puts it in a local folder, then loops though the file and creates one folder for each username mentioned in the file. "siloen" is the name of the fileserver on which all Home-folders, Profile-folders and other personal stuff is kept.

My script now runs as a scheduled task.

I was expected a lot of trouble with user rights to this folder, but it seems it is not needed.  At least the users created this way and with home folders created by the above script seems to work perfectly fine.
0
 

Author Closing Comment

by:lotveito
ID: 37864768
I found my own solution
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
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 …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

971 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