Active Directory – How to Massively Create Home Folders for Users

active-directorywindows-server-2008

I have 100 users in my forest.
We never used 'home' folder capabilities of Active Directory, now i would like to use.

The problem is that is less efficient to create manually 100 folders and assign permission.

Is there a way to create a automatically folder for each user and assign it to the 'home' folder of active directory ?

Thanks

Best Answer

First of all, the "Home Folder" attribute is a legacy thing. You should probably use either GPO Folder Redirection or a GPO Mapped Drives policy that includes the %username% variable to match the folder name.

If you use Folder Redirection, you can configure it to create the folders for each user if they don't exist. This is the easiest way.

You can certainly script all of this if you don't go the redirection route, but it highly depends on your environment. If you're using PowerShell (which you should), you're going to want the get-aduser, get-acl, set-acl, and new-item cmdlets at a minimum.

You can find out more info and see examples on all of these using the get-help <command> -full command. In order to use get-aduser to enumerate your existing users, you're going to need the AD PowerShell module. You get this from installing the AD Command-line tools in RSAT.