|
|
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
|
|