I used a script to change 2 fields in the users profiles on a wi 2k server DC.
the script worked fine except I changed to home directory to \\dc1\home\%USERNAME% that worked but in order to get the enviroment varible to pick up the usersname i have to open eack profile and manually apply it. is there an addition I can make to the script to avoid this.
If so the users home dir already exists which gives a prompt that tells you "the folder alreay exists bla bla bla ..." this needs to be answered in the script as well.
thanks for any help.
Here's the script:
Dim oContainer
Set oContainer=GetObject("LDAP://OU=linden,DC=ywc,DC=com"
ModifyUsers oContainer
'cleanup
Set oContainer = Nothing
WScript.Echo "Finished"
Sub ModifyUsers(oObject)
Dim oUser
oObject.Filter = Array("user"
For Each oUser in oObject
oUser.Put "homeDirectory","\\dc1\home\%USERNAME%"
oUser.Put "ScriptPath","ywc02.bat"
oUser.SetInfo
Next
End Sub
the script worked fine except I changed to home directory to \\dc1\home\%USERNAME% that worked but in order to get the enviroment varible to pick up the usersname i have to open eack profile and manually apply it. is there an addition I can make to the script to avoid this.
If so the users home dir already exists which gives a prompt that tells you "the folder alreay exists bla bla bla ..." this needs to be answered in the script as well.
thanks for any help.
Here's the script:
Dim oContainer
Set oContainer=GetObject("LDAP://OU=linden,DC=ywc,DC=com"
ModifyUsers oContainer
'cleanup
Set oContainer = Nothing
WScript.Echo "Finished"
Sub ModifyUsers(oObject)
Dim oUser
oObject.Filter = Array("user"
For Each oUser in oObject
oUser.Put "homeDirectory","\\dc1\home\%USERNAME%"
oUser.Put "ScriptPath","ywc02.bat"
oUser.SetInfo
Next
End Sub