Share via


Accessing Active Directory Properties

Accessing Active Directory Properties

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The Microsoft® Active Directory® directory service in Microsoft Windows® server operating systems contains information about users, groups, organizations, and services in your enterprise. You can locate Active Directory information by querying for properties of an Active Directory object. You can access Active Directory properties with the GetUserProperty Method of the IWorkflowSession Interface. For example, a user may submit a form to a workflow-enabled folder. You might want the workflow to notify the user's manager when a new form is submitted. One way to obtain the manager's e-mail address is to look it up in Active Directory by using the manager property of the user object.

The following code gets the e-mail address for the manager of the user who submitted the form. The code first gets the distinguished name (DN) of the manager from Active Directory, and then it uses the manager's distinguished name (DN) to get the manager's e-mail address.

VBScript

' Action Script Procedure:
mgr = GetUserMgr(WorkflowSession.Sender)

' Shared Script:
Function GetUserMgr(UserAddress)
   with WorkflowSession
      mgrDN = .GetUserProperty(UserAddress, "manager", 0) '0 = cdowfUserEmailAddress
      GetUserMgr = .GetUserProperty(mgrDN, "mail", 1) '1 = cdowfDistinguishedName
   end with
End Function

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.