Solved

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

Posted on 2004-09-09
3
765 Views
Last Modified: 2008-01-09
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
Comment
Question by:phsteele
3 Comments
 

Author Comment

by:phsteele
ID: 12179212
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12393981
PAQed, with points refunded (50)

Computer101
E-E Admin
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now