User-1732200463 posted
Hello Forum Folks,
If I picked the wrong category to put this problem in, I kindly apologise in advance.
Synopsis: I have an ASP.NET web application in C#. Under certain conditions, it will create security groups in AD. I need to email-enable these AD groups. It is my understanding that this can be accomplished through CDOEXM with the
following example code:
//Bind to group using account with permission to mail enable objects
DirectoryEntry ADGroup = new DirectoryEntry("LDAP://mydc.com/"+GroupDN,"svcacctusername", "svcacctpassword");
//Cast Native Object to CDOEXM
IMailRecipient MailRecip = (IMailRecipient)ADGroup.NativeObject;
//Mail Enable
MailRecip.MailEnable(null);
//Save Object Changes
ADGroup.CommitChanges();
Because CDOEXM only resides on Exchange servers, this code must be run on an exchange server. Theoretically, I need to create a DCOM wrapper with the above code, place it somewhere on the exchange server then call said code from the ASP.NET code on
the IIS server. Is that the correct way to do this, or is there a better way?
For a CDOEXM refresher:cdoexm.dll
First problem: creating the DCOM wrapper. I copied the CDOEXM.dll to my machine then tried to use the 'Add Reference' in Visual Studio to import it. It fails with this message - "A reference to 'D:\filepath\codexm.dll could not be added.
Please make sure that the file is accessible, and that it is a valid assembly or COM component". I believe I need to register this dll with my system first, but I'm not sure that is possible because it seems that I need Exchange Administrative Tools
installed as well and I assume that requires Exchange, which I don't think I can get installed on my dev box. Is there another way to develop this code?
Second problem: My ASP.NET app is on one server and Exchange is on another. How do I call the DCOM wrapper from a different machine? Where do I place the DCOM wrapper code? What do I need to do to make it accessible from another machine?
Thanks in advance for your input
--awclements