This should get you most of the way there. It doesn't include the profile
path, but that should be just an extra line or two below the HomeDirectory.
Watch for line wraps and change the value for strHomeDir to your real server
name.
'==============start=============================
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objRoot = Getobject("LDAP://rootDSE")
strDomain = objRoot.Get("defaultNamingContext")
strHomeDir = "\\server2\"
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADSDSOObject"
adoConnection.Open "", "", ""
strStartOU = InputBox ("Enter the OU where the user accounts reside:")
thisDate = FormatDateTime(Now(), 1)
fileName = userID & "HomeDir.txt"
set fileSys = CreateObject("Scripting.FileSystemObject")
set fileTxt = fileSys.OpenTextFile(fileName, ForAppending, True)
fileTxt.WriteLine(thisDate)
fileTxt.WriteLine(vbCrLF)
'On Error Resume Next
Set adoRecordset = adoConnection.Execute _
("<LDAP://" & strStartOU & "," & strDomain & ">;(objectCategory=person);" _
& "Name,SAMAccountName,ADsPath;SubTree")
adoRecordset.MoveFirst
While NOT adoRecordset.EOF
userADSPath = adoRecordset.Fields.Item("ADsPath")
strUserID = adoRecordset.Fields.Item("SAMAccountName")
set objUser = GetObject(userADSPath)
objUser.HomeDirectory = strHomeDir & strUserID
objUser.HomeDrive = "H:"
objUser.SetInfo
fileTxt.WriteLine("Home Directory and Drive set for " & strUserID)
adoRecordset.MoveNext
Wend
wscript.echo "End of script"
'========================end================================