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

MailEnable distribution groups

Subject: MailEnable distribution groups
From: "Anders Dahl Tollestrup"
Date: Fri, 27 Oct 2006 13:44:23 +0200
Newsgroups: microsoft.public.exchange.development
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