Is there a way to set each users home directory when running this script
Const ForReading = 1
Set objShell = WScript.CreateObject ("WScript.Shell")
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Set fileObject = objFSO.OpenTextFile("C:\VB\File.txt", ForReading)
Do While Not fileObject.AtEndOfStream
strLine = fileObject.ReadLine
aArray = Split(strLine, ",")
sUser = aArray(0)
sPassword = aArray(1)
sEmail = aArray(2)
WScript.Echo sUser
WScript.Echo sPassword
WScript.Echo sEmail
'Loop
Dim oContainer
Dim oUser
Set oContainer=GetObject("LDAP://OU=Student,DC=MYCSU,DC=ces,DC=edu")
'Create user
Set oUser = oContainer.Create("User","CN=" & sUser)
'Assign values to user attributes
oUser.Put "samAccountName", sUser
oUser.SetPassword sPassword
oUser.Put "givenName", sUser
oUser.Put "sn", sUser
oUser.Put "userPrincipalName", sEmail
oUser.Put "mail", sEmail
oUser.SetInfo
oUser.SetPassword sPassword
oUser.SetInfo
oUser.AccountDisabled = False
oUser.SetInfo
'Clean up
Set oUser = Nothing
Set oContainer = Nothing
WScript.Echo "Finished"
'WScript.Quit
Loop
Const ForReading = 1
Set objShell = WScript.CreateObject ("WScript.Shell")
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Set fileObject = objFSO.OpenTextFile("C:\VB\File.txt", ForReading)
Do While Not fileObject.AtEndOfStream
strLine = fileObject.ReadLine
aArray = Split(strLine, ",")
sUser = aArray(0)
sPassword = aArray(1)
sEmail = aArray(2)
WScript.Echo sUser
WScript.Echo sPassword
WScript.Echo sEmail
'Loop
Dim oContainer
Dim oUser
Set oContainer=GetObject("LDAP://OU=Student,DC=MYCSU,DC=ces,DC=edu")
'Create user
Set oUser = oContainer.Create("User","CN=" & sUser)
'Assign values to user attributes
oUser.Put "samAccountName", sUser
oUser.SetPassword sPassword
oUser.Put "givenName", sUser
oUser.Put "sn", sUser
oUser.Put "userPrincipalName", sEmail
oUser.Put "mail", sEmail
oUser.SetInfo
oUser.SetPassword sPassword
oUser.SetInfo
oUser.AccountDisabled = False
oUser.SetInfo
'Clean up
Set oUser = Nothing
Set oContainer = Nothing
WScript.Echo "Finished"
'WScript.Quit
Loop