Using the Report Management Agent and Cdir_ldp.exe to Perform a Bulk Reset of Metaverse Attributes (311149)



The information in this article applies to:

  • Microsoft Metadirectory Services 2.1
  • Microsoft Metadirectory Services 2.2
  • Microsoft Metadirectory Services 2.2 SP1

This article was previously published under Q311149

SUMMARY

If you have to reset or modify attributes in the metaverse, you may find it time consuming to use a single object tool, such as Ldp.exe, to perform this task. To quickly change multiple records in the metaverse, you can use the record selection and output format capabilities of the Report management agent to feed information to Cdir_ldp.exe, and then use the modification capabilities of Cdir_ldp.exe. If you do so, you do not add the extra cost of an associated connector space.

MORE INFORMATION

The example that is described in this section assumes that the selected metaverse objects contain a single-valued attribute called favoriteColour and that you are using this management agent to select the person objects that have midnight black value in the favoriteColour attribute, and then change the value for these objects to bright sunshine.

NOTE: This example assumes that you are modifying single-valued attributes. This example does not describe how to update multiple-lined or multiple-valued attributes. Additionally, use this example only as a one-time operation so that you can avoid manually resetting an attribute in a metaverse or connector space. However, if you want to modify attributes in this manner on a continuous basis, Microsoft recommends that you code a generic management agent. You can use this newly coded management agent as part of your overall metadirectory implementation.

To use the Report management agent to change multiple records in the metaverse:
  1. Log on to Microsoft Metadirectory Services (MMS) as an administrator.
  2. Click Bookmarks in the left pane, and then click Management Agents.
  3. Click Actions in the left pane, and then click Create New Management Agent.
  4. Give the management agent an appropriate name, for example Q311149 Test Report MA.
  5. In the Type of Management Agent box, click Report Management Agent.
  6. Click Create.
  7. On the Inclusions and Exclusions tab, modify condition 01 so that it matches the following data:
    condition 01
    $mv_object_class("zcperson") = TRUE
    $mv.favoriteColour = midnight black
  8. Click Actions in the left pane, and then click Design MA.
  9. Click the Design Report Format tab, and then click Report Format.
  10. Click the Header tab, and then remove the header template contents.
  11. Click the Trailer tab, and then remove the trailer.
  12. Click Add, and then change the template data so that it matches the following data:
    M $mv.dn
    -favoriteColour: bright sunshine
    ---
    						
    NOTE: Make sure to include a carriage return or a line feed at the end of the line that has the three en dashes (-). If you do so, each record begins on a new line.

    You must make these changes on the Add template because the Report management agent only sees the selected objects as Add candidates. Even though you want to modify metaverse objects, you do not use the Modify template.
  13. Click OK.
  14. Click Actions in the left pane, and then click Operate MA.
  15. Record the path of the Zscript.log file.
  16. Click Generate Report, and then review the Export file in the management agent's working folder to make sure that all of the correct objects were selected and that the information pertaining to each object is correct and properly formatted.
  17. Repeat steps 1 through 3.
  18. Give the management agent an appropriate name, for example Q311149 CDIR_LDP Update MA.
  19. In the Type of Management Agent box, click Netscape LDAP Management Agent.
  20. Click Create.
  21. Click Actions in the left pane, and then click Configure MA.
  22. Click the Discovery tab.
  23. In LDAP server address/name box, type the name of the MMS server, for example mms1.microsoft.com.
  24. In the LDAP TCP/IP port box, type the correct LDAP port number for the MMS server.

    This value is located in the upper right corner of the MMS snap-in.
  25. Leave the Context Prefix box blank.
  26. In the Login as box, type the complete MMS distinguished name (DN) of the MMS server (for example, type cn=Administrator,dsaname=mms1).
  27. In the Password box, type the administrator's password.
  28. Click Test your configuration.

    This test must be successful before you go to the next step.
  29. Click the Foreign Users tab, type the DN of the top object of the tree in the Foreign user's organizational unit box (for example, type dc=com if your naming context is similar to dc=microsoft,dc=com).
  30. Click the Attributes to discover tab, view the Attributes Discovered list, and then make sure that all of the attributes that are referenced in the Add template of the Report management agent are listed.

    In this example, the only required attribute is favoriteColour. If you have to add any attributes, add them to the end of the list.
  31. Click OK.
  32. Click Actions in the left pane, and then click Design MA.
  33. Click the MA Control MA Operations tab, and then click the MA Control Script tab.
  34. Scroll through the template code to the section that begins with the following instructions:
    IF %zcDsPerformForeignUpdates% = TRUE THEN
  35. Type a number sign (#) at the left margin of the line that begins with the following text:
    EXECUTE importt -updateDib -populator/update, 
    					
  36. Click OK.
  37. Click Actions in the left pane, and then click Operate MA.
  38. Click the Operational Settings tab.
  39. In the Tasks To Run group, click only Update connected directory.
  40. In the Types of Objects to Process group, click only Process foreign users.
  41. Click the Management Agent Logs tab, and then click the Operator's Log tab.
  42. Record the path of the Zscript.log file
  43. Copy the Export file from the Report management agent's working folder to the Netscape working folder.

    Make sure that the file is still named Export.
  44. Click Run the Management Agent.
To configure the Report management agent to process the metaverse connector spaces:
  1. Click Actions in the left pane, and then click Design MA.
  2. Click the Design Report Format tab, and then click the Report Control Script tab.
  3. Modify the template code which calls "importt" so that it matches the following text:
    #Generate the report
    EXECUTE importt -updateDib -populateDsa -populator/update -currentDn "%dn%"  +
                   -logFileName %zcDsDirectory%\dsforn.log
    					
  4. Click OK.

Modification Type:MajorLast Reviewed:6/6/2003
Keywords:kbinfo KB311149