[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/08/2008 at 11:22PM PDT, ID: 23634674
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

How can I pass multiple AD objects as vbscript Arguments?

Asked by zoofan in VB Script, Windows 2000 Server, Programming Languages

I am attempting to create a vbscript for use with an Active Directory Users And Computers modification to extend the abilities of the context menu of the user object.  The schema has already been edited and a script created and tested.

Upon selection of a single user, right clicking the user brings up the context menu with the custom entry, which when selected executes the script functioning correctly without error or issue however, my question is...

When selecting multiple users why does the script not receive any of the user objects selected as multiple arguments. (tested using both 2000 AD and 2003 AD same results)

What am I doing wrong here?


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you have a premodified ADUC you can test this script below which does nothing but display the agruments passed to the script.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
     Testing while selecting one single user object displays 2 arguments, the users distinguishedName and the object class ('user' in this case)
     Testing while selecting two or more user objects and executing results in no output at all,--> arguments.count = null (no msgbox on line 7 no error)


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you do not have a premodified ADUC Instructions to edit a test domain for the purpose testing the script are as follows:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    from http://www.2000trainers.com/windows-scripting/extend-aduc-vbscript/
   1. Open ADSI Edit (located in the Support Tools folder of the Windows Server 2003 CD)
   2. Expand the CN=Configuration node and navigate to CN=DisplaySpecifiers, CN=409. Select the 409 node in the left hand pane.
   3. In the right-hand pane, select the CN=user-Display object. Right click and select Properties.
   4. Select the adminContextMenu attribute and click Edit.
   5. We now need to add the value that will be used to create the additional menu item and direct it to the MultiArgs.vbs script. The syntax is very important.
        Be sure to include the comma at the beginning and after the menu name (Mutli_args). Add the following syntax to the Value to Add: line:
        ,&Multi-Args,c:\multiargs.vbs
   6. Change the servername and sharename items to reflect your current environment and then click Add.
   7. Click OK to accept the changes and close ADSI Edit.
   8. Allow some time for replication to populate the changes throughout the directory.
   9. Open ADUC and select a user. Right click on the user and notice the new menu item now available.
  10. Select Employee-ID to launch the script from within the ADUC
  11. From here we can either enter a new value for the employeeID attribute for the user or hit Cancel to leave the current value intact.
        (Note: If no value is present in the field, then the attribute value is empty for that user.)


-----------------------------------------------------------------------------------------------------------------------------------
If the answer is "You can't",  I can (sadly)accept that, still grading an 'A' with supporting documentation.
-----------------------------------------------------------------------------------------------------------------------------------

Thanks in advance,

zf
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
'save as c:\multiargs.vbs
Option Explicit
Const intFirstArg = 0
Dim intLastArg
Dim intArgIndex
Dim arrArgumentList
                Set arrArgumentList = WScript.Arguments
                MsgBox arrArgumentList.Count
                        If arrArgumentList.count > 0 Then
                        intLastArg = arrArgumentList.Count -1
                                For intArgIndex = intFirstArg To intLastArg
                                        MsgBox arrArgumentList(intArgIndex)
                                Next
                        End If
                Set arrArgumentList = Nothing                   
WScript.Quit(0)
[+][-]08/10/08 10:50 PM, ID: 22202019

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, Windows 2000 Server, Programming Languages
Sign Up Now!
Solution Provided By: RobSampson
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08/10/08 11:14 PM, ID: 22202099

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/10/08 11:26 PM, ID: 22202128

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/10/08 11:38 PM, ID: 22202166

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/10/08 11:43 PM, ID: 22202188

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/08 12:02 AM, ID: 22202271

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 / EE_QW_EXPERT_20070906