I have created a script which automatically creates users and assign them to security groups. It also created and sets home folder. Before I post my problem, just heave a look at this script:
'Create home folder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder("\\terra\home\2010\" &
strSAMAccountName)
Now the problem am facing is don’t know why the folder does not map in the login script at first logon. However at the end of script, everything works fine as permissions are also set properly. Continuing with the problem, when any of my client user trued to access the home folder manually, Windows XP gives an error message saying ‘Disallowed.’'Set permissions
Set oShell = wscript.CreateObject("Wscript.Shell")
oShell.Run "%COMSPEC% /c Echo Y| cacls \\terra\home\2010\"&
strSAMAccountName & " /t /e /g Administrators:F "& strSAMAccountName &
":C /R Students", 2, True
'Set home directory and home drive
objNewUser.Put "homeDirectory", "\\terra\home\2010\" &
strSAMAccountName
objNewUser.SetInfo
objNewUser.Put "homeDrive", "H"
objNewUser.SetInfo
I know I can fix it by going to AD users and computers and configuring the settings manually, but it is going to be hectic because we have more than 500 users and it continues every year’s beginning. So I want to know if it is possible using the script itself?
Bookmarks