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

Re: Attribute doesn't Exist??? Help. by Richard

Richard
Fri Nov 10 15:50:05 CST 2006

Check this link:

http://msdn2.microsoft.com/en-gb/library/aa380823.aspx

It seems you must use OpenDSObject to bind to the user object:

Set DSO = GetObject("LDAP:")
Set objUser = DSO.OpenDSObject("LDAP://cn=Jim
User,ou=Sales,dc=MyDomain,dc=com")

Also note the requirements at the bottom of the link:

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"KWME" <KWME@discussions.microsoft.com> wrote in message
news:CC245406-5CE4-45A0-B482-685762C5F8E2@microsoft.com...
>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



Re: Attribute doesn't Exist??? Help. by dNagel

dNagel
Fri Nov 10 15:53:40 CST 2006

It is within your power to set up your mail client to break the lines at
any character
column you want... I use 200 for my posts and insert line breaks where
_I_ want them.

thunderbird: Tools, Option, Composition : Wrap Plain Text Messages at: 200

Outlook/express offers similar functionality. I'm unfamiliar with your
agent
Microsoft CDO for Windows 2000
Produced By Microsoft MimeOLE V6.00.3790.1830

Or post in HTML... some may complain, but it's worth not having to fix
other posters
code to evaluate it.

D.



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

Re: Attribute doesn't Exist??? Help. by KWME

KWME
Sat Nov 11 23:08:03 CST 2006

I hear your point. Sorry for the messy script. I use the microsoft groups
page and I can't see a place to adjust the column widths.

K

"dNagel" wrote:

> It is within your power to set up your mail client to break the lines at
> any character
> column you want... I use 200 for my posts and insert line breaks where
> _I_ want them.
>
> thunderbird: Tools, Option, Composition : Wrap Plain Text Messages at: 200
>
> Outlook/express offers similar functionality. I'm unfamiliar with your
> agent
> Microsoft CDO for Windows 2000
> Produced By Microsoft MimeOLE V6.00.3790.1830
>
> Or post in HTML... some may complain, but it's worth not having to fix
> other posters
> code to evaluate it.
>
> D.
>
>
>
> KWME wrote:
> > 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
> >
>