17.19. Mail-Disabling a Contact

Problem

You want to mail-disable a contact.

Solution

Using a graphical user interface

  1. Open the ADUC snap-in.

    Tip

    This needs to be run on a workstation or server that has the Exchange Management Tools loaded (see Recipe 17.6).

  2. If you need to change domains, right-click on Active Directory Users and Computers in the left pane, select Connect to Domain, enter the domain name, and click OK.

  3. In the left pane, browse to the parent container of the user, right-click on the user, and select Exchange Tasks.

  4. On the Welcome screen, click Next.

  5. Select Remove Exchange Attributes and click Next.

  6. Read the warning and click Next.

  7. On the Completion screen, click Finish.

Using a command-line interface

See the command-line example for Recipe 17.10.

Using VBScript

' This code mail disables a contact.
' ------ SCRIPT CONFIGURATION ------
strContactDN = "<ContactDN>"   
'              e.g., cn=jsmith,ou=Contacts,dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------
set objContact = GetObject("LDAP://" & strContactDN)
objContact.MailDisable
objContact.SetInfo( )
Wscript.Echo "Successfully mail-disabled contact."

Discussion

This recipe shows how to remove the Active Directory Exchange attributes for a previously mail-enabled contact. The solutions are identical to the solutions for mail-disabling users, shown in the Discussion for Recipe 17.10.

Tip

Mail-enabling a contact requires Exchange Data Administrator permissions. See the Discussion for Recipe 17.7.

See Also

Recipe 17.10 and MS KB 307350 (XGEN: Using ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.