Platform SDK: Exchange 2000 Server

Creating a Contact in the Active Directory

[This is preliminary documentation and subject to change.]

Creating a Contact object involves setting informational properties and saving the object to the Active Directory.

The LDAP URL is composed of prefixes and distinguishing names for the object that address its placement in the Active Directory hierarchy. Use the prefix CN for common (or canonical) names, DC for domains, and O or OU for organizations.

CN is used to uniquely identify the object, as well as to indicate its classification such as "users."

Use as many DCs as necessary for each qualification in the domain name.

Example LDAP URL for a Person Object

If John Smith is a person with an Exchange mailbox in somwhere.microsoft.com and the Exchange 2000 Server is named "theserver," the LDAP URL would be:

LDAP://theserver/cn=johnsmith,cn=users,dc=somwhere,dc=microsoft,dc=com

Example LDAP URL for a Contact Object

If a company named "Northwind Traders" uses "Northwind" as the name of its organization in somwhere.microsoft.com and the Exchange 2000 Server is named "theserver," the LDAP URL would be:

LDAP://theserver/o=northwind,dc=somwhere,dc=microsoft,dc=com

Example

This example creates a Person contact to the Active Directory.

[Visual Basic]
Dim oPerson As New CDO.Person
Dim strURL As String

oPerson.FirstName = "John"
oPerson.LastName = "Smith"
oPerson.HomeCity = "Redmond"
oPerson.HomeState = "Washington"
oPerson.Email = "jsmith@somewhere.microsoft.com"

strURL = "LDAP://theserver/cn=johnsmith,cn=users,dc=somwhere,dc=microsoft,dc=com"

'Save the contact
oPerson.DataSource.SaveTo strURL