![]() |
Table of Contents |
![]() |
Changing User SettingsUsing the LDAP provider, you can use Put to change user and group attributes. Dim oUser Set oUser = GetObject("LDAP://cn=DonJ,ou=MIS,dc=domain,dc=com") oUser.Put "description", "Author" oUser.SetInfo Keep in mind that users in particular offer a number of multivalued attributes. I discussed how to work with those in Chapter 14. Here's quick refresher. Const MVP_CLEAR = 1 Const MVP_UPDATE = 2 Const MVP_APPEND = 3 Const MVP_DELETE = 4 Dim objUser Set objUser = GetObject("cn=DonJ,ou=Sales,dc=braincore,dc=net") objUser.PutEx MVP_APPEND, "otherTelephone", Array("555-1212") objUser.SetInfo This example appends another telephone number to a user's otherTelephone multivalued attribute. You can also clear the attribute completely, delete entries, or change a particular entry. The following example adds a new telephone number, and then deletes it. Const MVP_CLEAR = 1 Const MVP_UPDATE = 2 Const MVP_APPEND = 3 Const MVP_DELETE = 4 Dim objUser Set objUser = GetObject("cn=DonJ,ou=Sales,dc=braincore,dc=net") objUser.PutEx MVP_APPEND, "otherTelephone", Array("555-1212") objUser.SetInfo objUser.PutEx MVP_DELETE, "otherTelephone", Array("555-1212") objUser.SetInfo The PutEx method accepts the operation type (clear, update, append, or delete), the attribute you want to change, and the value you want to update, append, or delete. In the case of a clear operation, you don't need to provide a new value; the attribute is simply cleared out completely. If you're using the WinNT provider, either you can set properties directly or you can use Put, just like the LDAP provider. |
![]() |
Table of Contents |
![]() |