Please help me troubleshoot...my eyes are weary.

I'm getting the following error when I run the script that I've included
below: Microsoft VBScript runtime error: Object required: '[string:
"\\mcistudentsvr01\MCISt"]'


Option Explicit 'Demands that variables are "dimmed".
'On Error Resume Next 'Continue despite errors. (Disable Until Script is
working.)

Dim objUser
Dim objOU
Dim objTermProfile
Dim TProfilePath
Dim arrMembersOf

Set TProfilePath = "\\studsvr01\MCIStudentProfiles\Terminal"

Set objOU = GetObject _
("LDAP://ou=Senior One,ou=Students,ou=Network
Users,dc=student,dc=local")
objOU.getInfo

arrMembersOf = objOU.GetEx("sAMAccountName")

For Each objUser in arrMemberOf
'Set the Terminal Services Profile Path for the account.
Set objTermProfile = _
GetObject("LDAP://cn=" & objUser & ",ou=Senior One,ou=
Students,ou=Network Users,dc=student,dc=local")
objTermProfile.TerminalServicesProfilePath = TProfilePath
objTermProfile.SetInfo

'Print Confirmation
WScript.Echo objUser & " has been given the new Terminal Services
Profile Path."

Next

WScript.Echo "Changes are complete."

Re: Runtime Error...Object Required Need Some Fresh Eyes by dNagel

dNagel
Thu Nov 09 22:41:33 CST 2006

second one in a short time tonight...

SET is reserved for onjects... yank SET and it s/b fine.

D.


KWME wrote:
> Please help me troubleshoot...my eyes are weary.
>
> I'm getting the following error when I run the script that I've included
> below: Microsoft VBScript runtime error: Object required: '[string:
> "\\mcistudentsvr01\MCISt"]'
>
>
> Option Explicit 'Demands that variables are "dimmed".
> 'On Error Resume Next 'Continue despite errors. (Disable Until Script is
> working.)
>
> Dim objUser
> Dim objOU
> Dim objTermProfile
> Dim TProfilePath
> Dim arrMembersOf
>
> Set TProfilePath = "\\studsvr01\MCIStudentProfiles\Terminal"
>
> Set objOU = GetObject _
> ("LDAP://ou=Senior One,ou=Students,ou=Network
> Users,dc=student,dc=local")
> objOU.getInfo
>
> arrMembersOf = objOU.GetEx("sAMAccountName")
>
> For Each objUser in arrMemberOf
> 'Set the Terminal Services Profile Path for the account.
> Set objTermProfile = _
> GetObject("LDAP://cn=" & objUser & ",ou=Senior One,ou=
> Students,ou=Network Users,dc=student,dc=local")
> objTermProfile.TerminalServicesProfilePath = TProfilePath
> objTermProfile.SetInfo
>
> 'Print Confirmation
> WScript.Echo objUser & " has been given the new Terminal Services
> Profile Path."
>
> Next
>
> WScript.Echo "Changes are complete."
>
>

Re: Runtime Error...Object Required Need Some Fresh Eyes by KWME

KWME
Fri Nov 10 09:38:01 CST 2006

Thanks for the help. It was driving me crazy. The obvious stuff...

"dNagel" wrote:

> second one in a short time tonight...
>
> SET is reserved for onjects... yank SET and it s/b fine.
>
> D.
>
>
> KWME wrote:
> > Please help me troubleshoot...my eyes are weary.
> >
> > I'm getting the following error when I run the script that I've included
> > below: Microsoft VBScript runtime error: Object required: '[string:
> > "\\mcistudentsvr01\MCISt"]'
> >
> >
> > Option Explicit 'Demands that variables are "dimmed".
> > 'On Error Resume Next 'Continue despite errors. (Disable Until Script is
> > working.)
> >
> > Dim objUser
> > Dim objOU
> > Dim objTermProfile
> > Dim TProfilePath
> > Dim arrMembersOf
> >
> > Set TProfilePath = "\\studsvr01\MCIStudentProfiles\Terminal"
> >
> > Set objOU = GetObject _
> > ("LDAP://ou=Senior One,ou=Students,ou=Network
> > Users,dc=student,dc=local")
> > objOU.getInfo
> >
> > arrMembersOf = objOU.GetEx("sAMAccountName")
> >
> > For Each objUser in arrMemberOf
> > 'Set the Terminal Services Profile Path for the account.
> > Set objTermProfile = _
> > GetObject("LDAP://cn=" & objUser & ",ou=Senior One,ou=
> > Students,ou=Network Users,dc=student,dc=local")
> > objTermProfile.TerminalServicesProfilePath = TProfilePath
> > objTermProfile.SetInfo
> >
> > 'Print Confirmation
> > WScript.Echo objUser & " has been given the new Terminal Services
> > Profile Path."
> >
> > Next
> >
> > WScript.Echo "Changes are complete."
> >
> >
>