I get (null): The specified directory service attribute or value does not
exist. for line (27,4) in the script below. Any suggestions? Line 27 is the
one containing objTermProfile.SetInfo.
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 '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("L:\TRANSFER\Class Lists
2006\10list.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 Terminal Services Profile Path for the account.
strUser=objExcel.Cells(intRow,1).value
Set objTermProfile=GetObject("LDAP://mcistudsvr01/cn=" & strUser &
",ou=Senior Two,dc=mcistudent,dc=local")
objTermProfile.Put
"TerminalServicesProfilePath","\\mcistudsvr01\Profiles\Terminal"
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