Scripts Thread, VBScript Error in Coding and Web Development; Is the error occuring when binding to the group object or when adding the user to the group?
Try using ...
-
13th September 2007, 11:54 AM #16 Re: VBScript Error
Is the error occuring when binding to the group object or when adding the user to the group?
Try using WScript.Echo strUserDN and WScript.Echo strGroup to see what these variables are set to.
Looking at your code the group should be called students and in an OU called Groups which is in the root of the directory. The user objects should should be in an OU called Year5, which is in an OU called Students, which is in the directory root. Is this correct?
Iain.
-
-
IDG Tech News
-
13th September 2007, 01:17 PM #17
- Rep Power
- 0
Re: VBScript Error

Originally Posted by
Iain Is the error occuring when binding to the group object or when adding the user to the group?
Try using WScript.Echo strUserDN and WScript.Echo strGroup to see what these variables are set to.
Looking at your code the group should be called students and in an OU called Groups which is in the root of the directory. The user objects should should be in an OU called Year5, which is in an OU called Students, which is in the directory root. Is this correct?
Iain.
I am definitely pointing to the right areas for the user and group. Having transferred my code to NoteTab Lite, I now know that it has a problem with the strUserDN line - claiming that there is no such object on the server.
I can't seem to use the WScript.Echo because the program stops as soon as it gets to the problem, and I can only put the echo after those lines.
-
-
13th September 2007, 01:39 PM #18 Re: VBScript Error
You can put a WScript.Echo anywhere you like in a script.
If you want to know the value of strUserDN before it is used, put the echo command before the line
Code:
objGroup.Add(strUserDN)
If you want to know the vale of strGroup, put the echo command before the line
Code:
Set objGroup = GetObject(strGroup)
Iain.
-
-
13th September 2007, 01:54 PM #19
- Rep Power
- 0
Re: VBScript Error

Originally Posted by
Iain You can put a WScript.Echo anywhere you like in a script.
If you want to know the value of strUserDN before it is used, put the echo command before the line
Code:
objGroup.Add(strUserDN)
If you want to know the vale of strGroup, put the echo command before the line
Code:
Set objGroup = GetObject(strGroup)
Iain.
It seems to return back all the correct settings: The user is in an OU called "Year5" within an OU called "Students", and the group is called "students" in an OU called "Groups". Yet still it returns this "there is no such object on the server" error.
-
-
13th September 2007, 02:45 PM #20 Re: VBScript Error
The two OUs 'Students' and 'Groups' aren't inside any other OUs are they?
It may be worth downloading an LDAP browser, such as this (needs a java > 1.2.2)
If you use this to navigate to a user object in the Year5 OU and take a look at the distinguishedName attribute, this should be the same (excluding the ldap:// and different cn) as the output for strUserDN. Do the same for the Students group object and strGroup.
Iain
-
-
13th September 2007, 03:34 PM #21 Re: VBScript Error
Also try running the script in the Microsoft Script Debugger, this allows you to set breakpoints and check variable values on the fly.
Use either wscript //X <scriptname> or cscript //X <scriptname> to start the debugger.
Iain.
-
SHARE:
Similar Threads
-
Replies: 7
Last Post: 23rd September 2011, 03:21 PM
-
By Geoff in forum Scripts
Replies: 4
Last Post: 13th September 2007, 08:56 PM
-
By StewartKnight in forum Coding
Replies: 4
Last Post: 3rd May 2007, 05:41 PM
-
By StewartKnight in forum Coding
Replies: 5
Last Post: 1st May 2007, 11:04 AM
-
By mac_shinobi in forum Scripts
Replies: 1
Last Post: 20th February 2007, 11:29 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules