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