|
Prev: Doesn't work
Next: Renaming files
From: Udo on 25 Jun 2008 08:01 Hello, I am trying to create a distribution group and to mail enable it. I think the code is right, but I always get the runtimeerror: "Object doesn`t support this property or method objGroup.MailEnable" The error occurs on clients without ESM installed and on the Exchange Server himself! Code: Const ADS_GROUP_TYPE_GLOBAL_GROUP = 2 strGroupName = "GruppeDL" strGroupDisplay = "DE-GruppeDL" strGroupDescription = "Beschreibung BLABLA" strGroupHideFromGAL = "TRUE" Set objOU = GetObject ("LDAP://OU=org,dc=adstest,dc=local") Set objGroup = objOU.Create("Group", "cn=" & strGroupName) objGroup.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP objGroup.Put "sAMAccountName", strGroupName objGroup.SetInfo objGroup.put "displayName", strGroupDisplay objGroup.Put "proxyaddresses","SMTP:Schit(a)td.de" objGroup.Put "description", strGroupDescription objGroup.Put "MSExchHideFromAddressLists", strGroupHideFromGAL objGroup.SetInfo objGroup.MailEnable objGroup.SetInfo Does anyone have an idea why objGroup.MailEnable isn`t working? -- Gruß Udo
From: Richard Mueller [MVP] on 25 Jun 2008 11:06 "Udo" <Udo(a)discussions.microsoft.com> wrote in message news:29092D01-4E8B-4758-AF31-E238E6862B29(a)microsoft.com... > Hello, > > I am trying to create a distribution group and to mail enable it. > I think the code is right, but I always get the runtimeerror: "Object > doesn`t support this property or method objGroup.MailEnable" > The error occurs on clients without ESM installed and on the Exchange > Server > himself! > > Code: > > Const ADS_GROUP_TYPE_GLOBAL_GROUP = 2 > strGroupName = "GruppeDL" > strGroupDisplay = "DE-GruppeDL" > strGroupDescription = "Beschreibung BLABLA" > strGroupHideFromGAL = "TRUE" > > Set objOU = GetObject ("LDAP://OU=org,dc=adstest,dc=local") > Set objGroup = objOU.Create("Group", "cn=" & strGroupName) > objGroup.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP > objGroup.Put "sAMAccountName", strGroupName > objGroup.SetInfo > objGroup.put "displayName", strGroupDisplay > objGroup.Put "proxyaddresses","SMTP:Schit(a)td.de" > objGroup.Put "description", strGroupDescription > objGroup.Put "MSExchHideFromAddressLists", strGroupHideFromGAL > objGroup.SetInfo > objGroup.MailEnable > objGroup.SetInfo > > Does anyone have an idea why objGroup.MailEnable isn`t working? > > -- > Gru� Udo Don't assign a value to proxyAddresses. The MailEnable method of group objects assigns a value automatically based on sAMAccountName. You can modify it or add values later. I would create the group, assign groupType and sAMAccountName, then invoke SetInfo, then MailEnable, then assign other values. Remember that proxyAddresses is multivalued, and the values must be unique in the forest. Also, this requires CDOEXM, the value of cn must be unique in the OU, and the value of sAMAccountName must be unique in the domain. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net --
From: Udo on 26 Jun 2008 11:06 Hello Richard, > > Don't assign a value to proxyAddresses. The MailEnable method of group > objects assigns a value automatically based on sAMAccountName. You can > modify it or add values later. I would create the group, assign groupType > and sAMAccountName, then invoke SetInfo, then MailEnable, then assign other > values. Remember that proxyAddresses is multivalued, and the values must be > unique in the forest. Also, this requires CDOEXM, the value of cn must be > unique in the OU, and the value of sAMAccountName must be unique in the > domain. > > -- the mailenable object isn`t working in my script. Regardless where I run the code. (Exchange Server, Client with Outlook,...) Always the same error message! Code: Set objOU = GetObject ("LDAP://OU=org,dc=test,dc=local") Set objGroup = objOU.Create("Group", "cn=xxGruppeVB") objGroup.Put "sAMAccountName", "xxGruppeVB" objGroup.SetInfo objGroup.MailEnable objGroup.SetInfo Also the same message if I want to mail enable an group without mailfunction! In the past I had successfully used such a script with the method mailenable, but I don`t know if it was in this enviroment? What do I have to do, to activate CDOEXM? Thanks!
|
Pages: 1 Prev: Doesn't work Next: Renaming files |