So you need to assign and create home folders to a bunch of users and don´t really feel like doing it all the GUI way one by one?
I had this problem and I also needed to specify what users to create folders for by a list, and since email addresses are a good primary key I based my script on that.
This script will create folders, set permissions and update this information in the user objects in AD
First do Read
In Microsofts “How to assign a home folder to a user” you will find out how assign home folders in GUI or by scripting. When assigning a home folder in AD Users and Computers the AD takes care of creating the folder on specified share, but when assigning a home folder using the scripts they provide all you get is the path mapped in the users computer and in the AD user object, the folder is not created.
Then do Read
This script needs the path to a text file with the users email addresses** (one address per line), domain name,path to root of user share and a drive letter to the home folder (use a “high” one so you don´t get problems with card readers etc.).
** Can easily be changed to display name or samaccountname
! The script will set the users home folder name to “samaccountname_givenName-sn” (f ex. “jifr_Jimi-Friis”)
Powershell Script to add home folder path in Windows 2003 AD on users in list of email addresses
Script to add path to home folder in Windows 2003 AD
Then do Copy modify and enjoy! as always on your on risk 🙂
##***************************************************************************
## ***** Script Header *****
## File Name: AD_getUserLogonName_fromList_CreateAndSetHomFolder.ps1
# Author : Jimi Friis, www.newsweb.se
# Created: 2012-06-05
#
# Purpose: Set up home folder for Active Directory users specified as email adresses in a text file
# Continue reading Powershell Script to add home folder path in Windows 2003 AD on users in list of email addresses