Skip to Main Content
Active Directory, 3rd Edition
book

Active Directory, 3rd Edition

by Joe Richards, Robbie Allen, Alistair G. Lowe-Norris
January 2006
Beginner content levelBeginner
832 pages
27h 52m
English
O'Reilly Media, Inc.
Content preview from Active Directory, 3rd Edition

Mail-Disabling a Contact

Mail-disabling a contact is exactly like mail-disabling a user:

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

Tip

Mail-disabling a contact requires Exchange Data Administrator permissions.

Previously it was mentioned that you needed to know if the user was mail-enabled or mailbox-enabled. This is not the case with contacts because they cannot be mailbox-enabled; you can always use the MailDisable method for Exchange contacts.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory, 4th Edition

Active Directory, 4th Edition

Brian Desmond, Joe Richards, Robbie Allen, Alistair G. Lowe-Norris
Active Directory, Second Edition

Active Directory, Second Edition

Robbie Allen, Alistair G. Lowe-Norris

Publisher Resources

ISBN: 0596101732Supplemental ContentErrata Page