Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 808
  • Last Modified:

How do you mail-enable a Windows group in C#

I need to mail-enable a standard Active Directory group in a C# program. For a user object the following code works fine:

DirectoryEntry user = new DirectoryEntry("LDAP://cn=user,dc=...");
CDOEXM.IMailRecipient euserl;  
euser = (IMailRecipient) user.NativeObject;
euser.MailEnable("SMTP:username@exhange.domain.com);  

If I create a directory entry pointing to a group object, the call to MailEnable gives the error "The parameter is incorrect". I presume it's referring to the "SMTP:..." string, although that is a required parameter. I suspect it's a very simple problem but it's difficult to find information on CDOEXM. I've run out of google searches!
0
phsteele
Asked:
phsteele
1 Solution
 
phsteeleAuthor Commented:
I found a very simple solution. To mail enable a group the call to MailEnable must have an emptry string. For example:

group.MailEnable("");
0
 
Computer101Commented:
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now