Using CDO And ADSI For Contact Management - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Using CDO And ADSI For Contact Management

Description:

... virtual community web site. Schema for contact management. The CDO Person ... Creating a user. Leverage the person schema. Manage contacts in the Web Store ... – PowerPoint PPT presentation

Number of Views:362
Avg rating:3.0/5.0
Slides: 32
Provided by: robert1653
Category:

less

Transcript and Presenter's Notes

Title: Using CDO And ADSI For Contact Management


1
Using CDO And ADSI For Contact Management
Robert BrownProgram ManagerExchange Server
Product UnitMicrosoft Corporation
2
(No Transcript)
3
Agenda
  • Demo - virtual community web site
  • Schema for contact management
  • The CDO Person Object
  • Interacting with the Web Store
  • Interacting with the directory
  • Using ADSI to work with people and groups
  • CDO for Exchange Management

4
Demonstration
  • Sample Application

5
Person Schema
  • Exchange 5.5 and CDO 1.21
  • CDO 1.2 does not have a contact object
  • Outlook has a contact object but you cant use it
    on the server
  • Store had no knowledge of structured data
  • Developers had to invent schema, or figure out
    the Outlook schema
  • No interop with other popular person schemas like
    LDAP and VCard

6
Person Schema
  • Exchange 2000
  • Knows about and exposes structured data
  • Ships with a comprehensive and extensible set of
    schema
  • Including urncontent-classesperson
  • Based on LDAP
  • Normalized across VCARD, Outlook Express, and
    Outlook Contacts
  • Person schema also has built-in behaviors

7
Schema Inheritance
  • Subclass Exchange 2000 schema to fit your
    business needs

urncontect-classesobject
(base object)
urncontent-classesitem
(basic document properties)
urncontent-classesperson
(person-specific properties)
my-customer
my-competitor
(specific to your customers)
(specific to your competitors)
8
DemonstrationExchange 2000s Person schema
  • urncontent-classesperson has a comprehensive
    set of properties
  • The person schema is described using XML
  • Schema is directly leveraged by in Web Forms
  • Binding in native HTML no programming required!

9
Programming With The Person Schema
  • HTTP-DAV
  • OLE DB
  • ADO
  • CDO.Person

10
ADO - Code Sample
sDom mydom.myOU.myorg.com sMB /mbx/
useralias /contacts sURL file//./BackOffic
eStorage/ myDom sMB set rs
server.createobject("adodb.recordset") rs.Open
"select ""DAVhref"", ""urnschemascontactsfilea
s" from SCOPE('shallow traversal of " sURL
"")", "ProviderExoledb.DataSource.1 Data
Source sURL While Not rs.EOF
response.write _ rs.Fields("urnschema
scontactsfileas").Value rs.MoveNext Wend
sDom mydom.myOU.myorg.com sMB /mbx/
useralias /contacts sURL file//./BackOffic
eStorage/ myDom sMB
set rs server.createobject("adodb.recordset")
rs.Open "select ""DAVhref"", ""urnschemascontac
tsfileas" from SCOPE('shallow traversal of
" sURL "")", "ProviderExoledb.DataSourc
e.1 Data Source sURL
While Not rs.EOF response.write _
rs.Fields("urnschemascontactsfileas").Value
rs.MoveNext Wend
11
CDO Person Object Model
  • CDO.Person
  • CDO for Exchange Management
  • Extends CDO by adding two interfaces to
    CDO.Person
  • IMailRecipient
  • IMailBoxStore

12
CDO.Person
  • Models a Person in the contact database and in
    the Directory
  • Provides simple access to name, addresses,
    telephone numbers and email addresses properties
  • All other properties available through the fields
    collection
  • Supports VCard import and export

13
CDO.Person Interfaces
  • IPerson
  • IDataSource
  • IMailbox
  • IMailboxStore
  • IMailRecipient

14
IPerson Properties
  • Name
  • First, Middle, Last, Title, Initials, Suffix,
    Prefix
  • Address Properties
  • Separate sets of properties for Home, Work and
    Mailing addresses
  • Street, city, state, country, post code, postal
    address, P.O. Box

15
More IPerson Properties
  • E-mail addresses
  • Telephone numbers
  • Home and work phone,home and work fax, mobile
    phone
  • Fields Collection

16
IMailBox Properties
  • URLs to exchange folders
  • Inbox
  • Outbox
  • Contacts
  • Calendar
  • Etc.

17
IMailBox Code Sample
Set pers server.CreateObject("CDO.Person") Set
f server.CreateObject("CDO.Folder") set rs
server.CreateObject("ADODB.Recordset")
Set pers server.CreateObject("CDO.Person") Set
f server.CreateObject("CDO.Folder") set rs
server.CreateObject("ADODB.Recordset") pers.DataS
ource.Open "mailto" uid "_at_"
dnsdomain f.DataSource.Open pers.GetInterface("IM
ailbox").Inbox rs.Open "select from
SCOPE('shallow traversal of """ m.Inbox
"""')", _ f.DataSource.ActiveConnection Whi
le Not rs.EOF response.write
rs.Fields("DAVdisplayname").Value
rs.MoveNext Wend
pers.DataSource.Open "mailto" uid "_at_"
dnsdomain
f.DataSource.Open pers.GetInterface("IMailbox").In
box
rs.Open "select from SCOPE('shallow traversal
of """ m.Inbox """')", _
f.DataSource.ActiveConnection
While Not rs.EOF response.write
rs.Fields("DAVdisplayname").Value
rs.MoveNext Wend
18
Directory Integration
  • Contacts can exist in
  • Active Directory
  • Exchange 2000 Web Store (public or private)
  • Use CDO.Person to create contacts anywhere
  • Use CDO Contacts to bind to a Contact in the
    Directory and then save it to a contacts database

19
Directory Integration Code Sample
Copy pers1 from the DS into pers2s contacts
folder
Set pers1 server.CreateObject("CDO.Person") Set
pers2 server.CreateObject("CDO.Person") pers1.D
ataSource.Open "mailto" uid1 "_at_"
domain pers2.DataSource.Open "mailto" uid2
"_at_" domain pers1.DataSource.SaveToContainer _
pers2.GetInterface("IMailbox").Conta
cts
Set pers1 server.CreateObject("CDO.Person") Set
pers2 server.CreateObject("CDO.Person")
pers1.DataSource.Open "mailto" uid1 "_at_"
domain pers2.DataSource.Open "mailto" uid2
"_at_" domain
pers1.DataSource.SaveToContainer _
pers2.GetInterface("IMailbox").Contacts
20
ADSI IADs interface
  • Implemented by every base object
  • Properties
  • Name, ADsPath, class, schema, parent
  • Methods
  • Get, put, getinfo, setinfo
  • Using only the IADs interface you can learn all
    about an object and get or set all of its
    properties
  • Use GetObject(ADSPath)

21
ADSIReading And writing properties
  • Simple caching system
  • IADsGetInfo()
  • Reloads the cache with values from the
    underlying Web Store
  • Changes made in the cache are lost
  • IADsSetInfo()
  • Writes cached changesto the underlying Web Store

22
DemonstrationADSI and CDO.Person in the directory
  • Use CDO.Person to interact with the Directory
  • Use CDO.Person to save contacts from the DS to
    the Web Store

23
CDO For Exchange Management
  • CDOEXM (a.k.a. EMO) extends CDO and ADSI by
    adding management interfaces
  • Exchange 2000 release supports recipient and
    folder management
  • Exchange 2000 includes the following management
    interfaces
  • IMailRecipient
  • IMailBoxStore

24
CDO EXMObject model
  • CDOEXM extends CDO
  • Extends Person by adding IMailRecipient and
    IMailboxStore interfaces
  • Extends Folder by adding IMailRecipient
    interface
  • CDOEXM extends ADSI
  • Extends User with IMailRecipient and
    ImailboxStore interfaces
  • Extends Group and Contact with IMailRecipient
    interface

25
CDOEXM IMailRecipient
  • Provides access to the properties of a
    mail-enabled recipient in the DS
  • Promotes management properties
  • Proxy addresses
  • Send/deliver limits
  • Forwarding properties
  • Restricted address properties
  • Common management methods
  • Mail enable, mail disable

26
CDOEXMIMailboxStore
  • Provides access to the properties of a user with
    an Exchange mailbox
  • Promotes management properties
  • Store quotas
  • Garbage collection parameters
  • Mailbox location
  • Delegates
  • Common management methods
  • Create, delete and move mailbox

27
CDOEXM - Code SampleMailbox- enabling a user
Dim objUser As IADsUser Dim objMailbox As
CDOEXM.IMailboxStore Set objUser
GetObject("LDAP//exsrv1/CNuser1, OUMarketing
,DCmicrosoft,DCcom") objUser.CreateMailbox
"LDAP//exsrv1/CNPrivate MDB, CNSG1,CNInform
ationStore,CNEXMBSVR, CNServers,CNAG1, C
NAdministrative Groups,CNOrg, CNMicrosoft
Exchange,CNServices, CNConfiguration,DCmicro
soft,DCcom" objUser.SetInfo
Dim objUser As IADsUser Dim objMailbox As
CDOEXM.IMailboxStore
Set objUser GetObject("LDAP//exsrv1/CNuser1,
OUMarketing,DCmicrosoft,DCcom")
objUser.CreateMailbox "LDAP//exsrv1/CNPrivate
MDB, CNSG1,CNInformationStore,CNEXMBSVR,
CNServers,CNAG1, CNAdministrative
Groups,CNOrg, CNMicrosoft Exchange,CNService
s, CNConfiguration,DCmicrosoft,DCcom"
objUser.SetInfo
28
CDOEXM ADSI vs. CDO integration
  • ADSI provided for compatibility with existing DS
    scripts and applications
  • Use ADSI if you need to manage groups / Exchange
    distribution lists
  • CDO method preferred for collaborative
    applications and scripts
  • Use CDO if you need to manage Exchange public
    folders

29
CDOEXM DemoCreating a user
  • Adding subscribers to our Web site

30
Call To Action
  • Leverage the person schema
  • Manage contacts in the Web Store
  • use OLE DB/ADO and CDO.Person
  • Access persons in the DS
  • Use CDO.Person, ADSI, OLE DB/ADO
  • Use CDO.Person for in-memory behaviors
  • Leverage the person schema
  • Manage contacts in the Web Store
  • Use OLE DB/ADO and CDO.Person
  • Access persons in the DS
  • Use CDO.Person, ADSI, OLE DB/ADO
  • Use CDO.Person for in-memory behaviors

31
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com