Platform SDK: Active Directory, ADSI, and Directory Services

Setting Class Attributes

The following Visual Basic code example shows how set class attributes.

Dim objObject As IADs
Dim objClass As IADsClass
Dim varAttrib As Variant

Set objObject = GetObject _
     ("LDAP://Server/cn=Object,cn=Recipients,ou=Site,o=Orgcn=Object")
Set objClass = GetObject(objObject.Schema)

Debug.Print "Class: " & objClass.Name
Debug.Print "GUID: " & objClass.Guid
Debug.Print "Implemented by: " & objClass.CLSID
Debug.Print "Attributes in this Class: "
Debug.Print "Mandatory Attributes: "

For Each varAttrib In objClass.MandatoryProperties
    Debug.Print vbTab & varAttrib
Next varAttrib

Debug.Print "Optional Attributes: "

For Each varAttrib In objClass.OptionalProperties
    Debug.Print vbTab & varAttrib
Next varAttrib

Set objObject = Nothing
Set objClass = Nothing

Note: This example is specific to Exchange Server version 5.5 and below, and is not upwardly compatible with Exchange 6.0. Management and access of Exchange 6.0 Servers should be made through the CDO Exchange Management interfaces instead.