Recipe5.11.Creating a Mail-Enabled Contact


Recipe 5.11. Creating a Mail-Enabled Contact

Problem

You want to create a contact (or custom recipient, in Exchange 5.5 parlance) that can receive mail but that doesn't have a mailbox.

Solution

Using a graphical user interface

  1. Log on to any machine in your domain that has the Exchange management tools installed.

  2. Open the ADUC snap-in (Users and Computers.msc).

  3. Locate the domain and container in which you want to create the new contact.

  4. Right-click the appropriate container and use the New Contact command.

  5. When the New Object - Contact dialog appears, fill in the appropriate fields (first name, last name, full name, initials, and display name), then click Next.

  6. The New Object - Contact dialog will update so that it looks like Figure 5-3. If necessary, edit the alias and choose the administrative group where you want this contact to be expanded.

  7. Click the Modify button. The New E-mail Address dialog box will appear. Select the address type (for most uses it will be SMTP), then click OK.

  8. When the address properties dialog appears, enter the email address you want associated with the contact. For example, if your contact's external address is tim@oreilly.com, that's what you'd enter. Click OK, and then click Next.

  9. Click Finish to create the contact.

Figure 5-3. Specifying the alias and email address for a mail-enabled contact


Using a command-line interface

To create a mail-enabled contact from the command line, you need to combine the dsadd utility (which creates the contact) with exchmbx (which adds the necessary attributes for the actual mail enablement):

> dsadd contact "<contactDN>" -fn "<FirstName>" -ln "<LastName>"      -display "<DisplayName>" -email "<Email>"  > exchmbx -b "<contactDN>" -me

For example, these commands add a new contact entry for James Bond:

> Dsadd contact "cn=James Bond,cn=users,dc=Robichaux,dc=net" -fn "James" -ln "Bond"     -display "James Bond (007)" -email "007@secret-service.gov.uk" > Exchmbx -b "cn=James Bond,cn=users,dc=Robichaux,dc=net" -me

Using VBScript
' This code creates a new contact object ' ------ SCRIPT CONFIGURATION ------  strDCName = "<ServerName>"  ' e.g., batman  strContainer= "<container>" ' e.g., "/CN=Users, dc=robichaux, dc=net"  strContactName = "<contactName>"    ' e.g., "John Doe"  strContactAlias = "<contactAlias>" ' e.g., "JDoe"  strContactProxyAddr = "<contactSMTP>" ' e.g., "SMTP:jdoe@oreilly.com"  ' ------ END CONFIGURATION --------- Set objContainer = GetObject("LDAP://" & strDCName & strContainer) Set objContact = objContainer.Create("Contact", "cn=" & strContactName) objContact.Put "mailNickname", strContactAlias With objContact    .Put "mailNickname", strContactAlias    .Put "displayName", strContactName    .Put "targetAddress", strContactProxyAddr    .Put "systemFlags", 1610612736    .SetInfo End With WScript.Echo "Created contact " & strContactAlias & " at " &_     strContactProxyAddr

Discussion

Contacts differ from actual user objects in several ways, all of which are related to the set of attributes associated with the respective objects. Contacts aren't security principals and don't have any of the security principals' attributes, so they cannot be used to assign privileges or to log on, nor do they have any of the SID-related attributes (SAMAccountName, objectSID, userAccountControl, and userPrincipalName) that user accounts have. They also don't have mailboxes; instead, they use the proxy address field, familiar to us as the placeholder for the address of an account's mailbox, to forward mail sent to the contact. The advantage of this approach: contacts can appear in address lists, so they look just like every other mail-enabled object.

When you create a contact via ADSI, the Dsadd utility, or CSV import, you only have to specify two attributes: the DN (specified by combining the contact object's mailNickname attribute with its container path) and the primary email proxy address are required, but other attributes (including the display name, first name, last name, telephone number, and so on) are all optional. There are several important additional attributes (notably showInAddressBook, mAPIRecipient, and InternetEncoding) that will not be populated by the RUS when it next runs; you must stamp these values manually.

See Also

MS KB 275636 (Creating Exchange Mailbox-Enabled and Mail-Enabled Objects in Active Directory), MS KB 233209 (Windows 2000 Contacts and Users), and MS KB 327620 (How to use Csvde to import contacts and user objects into Active Directory)



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net