microsoft.public.exchange.development
[Top] [All Lists]

Re: MailEnable distribution groups

Subject: Re: MailEnable distribution groups
From: "Glen Scales [MVP]"
Date: Mon, 30 Oct 2006 09:39:03 +1100
Newsgroups: microsoft.public.exchange.development
To mail enable an object you need to use CDOEXM and the IRecipient interface 
see 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_imailrecipient_mailenable.asp.
 
There is some integration if you have CDOEXM installed on a machine that 
allows you to call the mailenable command directly from ADSI I don't believe 
this carries over into the .NET System.directoryservices class so I believe 
you will need to use CDOEXM via an interop.

Cheers
Glen

"Anders Dahl Tollestrup" <anders@xxxxxxxxxxxxx> wrote in message 
news:FF0542D3-51E6-4E21-9195-D72D20C20C51@xxxxxxxxxxxxxxxx
> Hi
>
> I am having some troubles in mail enabling a universal distribution group 
> in VB.NET 2.0.
>
> The code:
>
> NewGroupDE = BaseDE.Children.Add("cn=" & GroupName, "group")
> NewGroupDE.Properties.Item("sAMAccountName").Value = GroupName
> NewGroupDE.Properties.Item("displayName").Value = GroupName
> NewGroupDE.Properties.Item("groupType").Value = &H8
> NewGroupDE.Properties.Item("mailNickname").Value = GroupName.Replace(" ", 
> "")
> NewGroupDE.CommitChanges()
>
> NewGroupDE.NativeObject.Mail = SMTP
> NewGroupDE.NativeObject.MailEnable()
> NewGroupDE.CommitChanges()
>
> NewGroupDE and BaseDE is DirectoryEntry objects. The code halts on the 2nd 
> last codeline, when trying to execute the MailEnable command. It's claims 
> that MailEnable doesn't exist on that object.
>
> What am I missing ?
>
> Best regards,
> /Anders 



<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy