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

Re: VB Script Runs W/O Error, But Does Nothing! by Franz

Franz
Mon Dec 11 15:15:28 CST 2006

KWME wrote:
> 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?

> Do Until objExcel.Cells(intRow,1).Value = "" 'Initiate loop.

Maybe the cell is empty ? (if so the loop will not be executed).

try by changing the do-->loop with a small for next
(something like for x = 1 to 5), and add a MSGBOX to see
the cell content (something like msgbox objExcel.Cells(intRow,1).Value )
just to see if there is something in the cells... maybe you're
pointing to empty cells.