Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Create Distribution List

Reply
 
Old 09-29-2008   #1 (permalink)
Okupa


 
 

Create Distribution List

Hi guys, I need a script to create a Dls, in the thepository there is a one
to create groups :
Const ADS_GROUP_TYPE_LOCAL_GROUP = &h4
Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000

Set objOU = GetObject("LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com")
Set objGroup = objOU.Create("Group", "cn=DB-Servers")

objGroup.Put "sAMAccountName", "DBServers"
objGroup.Put "groupType", ADS_GROUP_TYPE_LOCAL_GROUP Or _
ADS_GROUP_TYPE_SECURITY_ENABLED
objGroup.SetInfo

It´s working fine, but I need know the atribute to create the exchange
atrubutes as distrubution group, and read the variable to the excel fiel.
Any idea?

Thanks


My System SpecsSystem Spec
Old 09-29-2008   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Create Distribution List

Okupa wrote:
Quote:

> Hi guys, I need a script to create a Dls, in the thepository there is a
> one
> to create groups :
> Const ADS_GROUP_TYPE_LOCAL_GROUP = &h4
> Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000
>
> Set objOU = GetObject("LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com")
> Set objGroup = objOU.Create("Group", "cn=DB-Servers")
>
> objGroup.Put "sAMAccountName", "DBServers"
> objGroup.Put "groupType", ADS_GROUP_TYPE_LOCAL_GROUP Or _
> ADS_GROUP_TYPE_SECURITY_ENABLED
> objGroup.SetInfo
>
> It´s working fine, but I need know the atribute to create the exchange
> atrubutes as distrubution group, and read the variable to the excel fiel.
> Any idea?
Your example creats a local security group, not a distribution group. To
create a domain local distribution group use:

Const ADS_GROUP_TYPE_LOCAL_GROUP = &H2

objGroup.Put "groupType", ADS_GROUP_TYPE_LOCAL_GROUP

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 09-29-2008   #3 (permalink)
Richard Mueller [MVP]


 
 

Re: Create Distribution List


"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
message news:uj4hcgjIJHA.1156@xxxxxx
Quote:

> Okupa wrote:
>
Quote:

>> Hi guys, I need a script to create a Dls, in the thepository there is a
>> one
>> to create groups :
>> Const ADS_GROUP_TYPE_LOCAL_GROUP = &h4
>> Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000
>>
>> Set objOU = GetObject("LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com")
>> Set objGroup = objOU.Create("Group", "cn=DB-Servers")
>>
>> objGroup.Put "sAMAccountName", "DBServers"
>> objGroup.Put "groupType", ADS_GROUP_TYPE_LOCAL_GROUP Or _
>> ADS_GROUP_TYPE_SECURITY_ENABLED
>> objGroup.SetInfo
>>
>> It´s working fine, but I need know the atribute to create the exchange
>> atrubutes as distrubution group, and read the variable to the excel fiel.
>> Any idea?
>
> Your example creats a local security group, not a distribution group. To
> create a domain local distribution group use:
>
> Const ADS_GROUP_TYPE_LOCAL_GROUP = &H2
>
> objGroup.Put "groupType", ADS_GROUP_TYPE_LOCAL_GROUP
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
Perhaps what you need is code to mail enable a distribution group (list)
using CDOEXM. For example:

objGroup.MailEnable
objGroup.SetInfo

The method automatically assigns the email address, based on sAMAccountName.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Distribution List Vista mail
Creating a distribution list from a long cc list Vista mail
Distribution List Live Mail
how to create a distribution list Vista mail
distribution list Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46