Auto create new directory for new user on Windows File Server

active-directoryfile-serveruser-management

On our network we give each user a network share at \\fileserver\users\username. These are intentionally NOT set up as their home directory, and are instead mapped by a login script every time the user logs on. For new users, this drive mapping fails, since the folder does not exist yet.

Is there a way that when we create a new user in Active Directory, it can automatically create the folder at \\fileserver\users\username? Or alternatively, that the folder can be created the first time it is accessed?

Failing that, can somebody show me how to manually create a folder with vbscript?

edit

So it appears that the logon script solution is not going to work for me, because the user doesn't have permission to create folders in \\fileserver\users. (and the script runs with the user's privileges) Any other ideas?

Best Answer

Set the permissions of \\fileserver\users as described in the Microsoft TechNet article entitled "Security Considerations when Configuring Folder Redirection" http://technet.microsoft.com/en-us/library/cc775853(WS.10).aspx. The situation you are describing is exactly the situation in which folder redirection operates. The permissions described will allow regular user accounts to create their own folders and then to access them, but they will not allow users to access folders belonging to others. Thus, a logon script will operate as you desire once these permissions are set.

For what it's worth, your next step along the road to best practices is to actually use folder redirection and get rid of drive mapping altogether. Windows surfaces redirected folders throughout the user interface, and so it is easier for users to find a redirected folder than a mapped drive. Also, folder redirection requires no scripting, and folder creation is automatic, which is what you want.