Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Modifying an object is equivalent to writing an attribute to an existing object in Active Directory. If an attribute contains a value, modifying it will clear the existing value and replace it with a different value.
Typically, the type of modification you make to an object will depend on the type of object you want to modify and various characteristics of the attribute for example, whether the attribute holds a single value or multiple values. For simplicity, however, the following task descriptions illustrate how to write a single value to the same attribute in three different objects.
Modifying attributes of Active Directory objects involves three basic steps:
The goal of the three scripts in this section is to write an attribute to each of the objects created in "Creating Directory Service Objects" earlier in this chapter. The objects include the HR OU, the MyerKen user account, and the Atl-Users global group. The description attribute is contained in all three of these objects, so it is used as the attribute to modify.
The script in Listing 5.5 modifies the description attribute of the OU named HR in the na.fabrikam.com domain. The description attribute is assigned the value Human Resources. To carry out this task, the script performs the following steps:
In contrast with the create task, the HR OU is referred to as an object rather than a container because the task completed in this script is to write an attribute of an object.
Listing 5.5 Writing the description Attribute to an OU
|
|
The script in Listing 5.6 modifies the description attribute of the user account named MyerKen in the HR OU of the na.fabrikam.com domain. The description attribute is assigned the value HR employee. To carry out this task, the script performs the following steps:
Listing 5.6 Writing the description Attribute to a User Account
|
|
The script in Listing 5.7 modifies the description attribute of the group account named Atl-Users in the HR OU of the na.fabrikam.com domain. The description attribute is assigned the value of Atlanta users. To carry out this task, the script performs the following steps:
Listing 5.7 Writing the description Attribute to a Group
|
|
Important observations about the scripts in this section are:
Send us your feedback | « Previous | Next » |