I've used this script in the past to change users Terminal Profile in Active
Directory. This time when I ran it and it went error-free, but did
absolutely noting by way of changing the Terminal Profile. Any ideas?
'**********************************************************************************
'* THIS SCRIPT CHANGES User Profiles *
'* WRITTEN BY KERRY *
'**********************************************************************************
Option Explicit 'Demands that variables are "dimmed".
'On Error Resume Next 'Continue despite errors. (Disable Until Script is
working.)
'Define Variables
Dim objExcel 'Creates Excel Instance
Dim objWorkbook 'Opens designated Excel Workbook
Dim intRow 'Contains the row number of the Excel worksheet.
Dim usrVar 'Contains the new user's full user name.
Dim objOU, strOU, strUser 'Binds to the Organizational Unit Object.
Dim objTermProfile
Dim strTSprofile 'Connect to the object.
Set objExcel = CreateObject("Excel.Application") 'Set the correct file
location for the excel data file.
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Set the class list
address below!!!!
Set objWorkbook = objExcel.Workbooks.Open("C:\Class Lists 2006\9list.xls")
'Open the class list file.
intRow = 2 'Variable for loop. Begins on 2 to bypass header row.
Do Until objExcel.Cells(intRow,1).Value = "" 'Initiate loop.
'Set the Profile Path and the Terminal Services Profile Path for the
account.
strUser=objExcel.Cells(intRow,1).value
Set objTermProfile=GetObject("LDAP://student1/cn=" & strUser & ",ou=Senior
One,dc=mcistudent,dc=local")
objTermProfile.Put
"TerminalServicesProfilePath","\\TERMINAL1\termProfile.man"
objTermProfile.SetInfo
WScript.Echo "The new TprofilePath has been added to " &
objExcel.Cells(intRow,4).Value & "'s account."
intRow = intRow + 1 'Advance to the next row.
Loop 'Repeat the loop.
WScript.Echo "CHANGES TO THE " & StrOU & " ORGANIZATIONAL UNIT ARE
COMPLETE."
objWorkbook.Save 'Save the Excel file.
objExcel.Quit 'Close the Excel thread and End Script