I thought I’d share the script attached at the end of this post as it’s something I’ve seen requests for below. The script will take all of the users in a given OU (or really any subtree), and create a home folder for them and stamp the path and drive letter on the user object in Active Directory. By default it only grants the users modify permissions on the account. If you want to change this modify the xcacls call around line 54.
There are a few constants which need to be configured at the top of the script which are explained with comments:
‘ The base OU to search (child OUs will be searched as well)
Const BASE_OU = “ou=accounting,ou=people,dc=mycompany,dc=com”
‘ The path to create the home folders in. Must have a trailing \
Const BASE_FOLDER = “\\someserver\Users\”
‘ Home folder drive letter
Const DRIVE_LETTER = “H:”
Feel free to post any suggestions, bugs, etc in the comments area and I’ll take a look. The script is enclosed in a zip as an attachment to this post.