' ' Author: Michael Battista ' Date: June 23, 2006 ' Location: http://www.ccs.neu.edu/home/battista/downloads/sethome.vbs ' Description: When run on a primary domain controller, this script ' will set the home directory of each domain user to the UNC path ' $homeShare\$username and map that directory to $homeDrive. Option Explicit Dim objDSE, objContainer, objChild, homeDrive, homeShare homeDrive = "Z:" homeShare = "\\g38fs\homedirs" Set objDSE = GetObject("LDAP://rootDSE") Set objContainer = GetObject("LDAP://CN=Users," & objDSE.Get("defaultNamingContext")) objContainer.Filter = Array("user") For Each objChild In objContainer objChild.put "HomeDrive", homeDrive objChild.put "HomeDirectory", homeShare & "\" & objChild.sAMAccountName objChild.SetInfo Next WScript.Echo("Home Directories Set")