Re: Adding a group to multiple Distribution list




"Amarnath" <Amarnath @discussions.microsoft.com> wrote in message
news:BD2EB60C-BF9D-45E2-92C2-EA68DC71C05F@xxxxxxxxxxxxxxxx
I just wanted to know, how to add a single group to multiple distribution
list (appr 150 lists).
and members those are in single group needs to manage all the 150
distribution lists (i.e they should be owner of the distribution list).

Help is really appreciated.

The "owner" of an object is specified in the security descriptor of the
object. But distribution lists do not have security descriptors, so they
cannot have an "owner". There is a managedBy attribute, which specifies the
user or contact that manages the group. However, this must be the
Distinguished Name of a user or contact. It cannot be a group. Exchange may
have some other mechanism for what you want.

To add a single group to multiple distribution groups, you must specify the
Distinguished Name of the group (of any kind) to be added as a member. Also,
you need a list of the Distinguished Names of the distribution groups,
perhaps in a text file. A VBScript solution would be similar to below:
===========
Option Explicit

Dim strGroupList, strNewMember, objNewMember, objGroup
Dim objFSO, objList, strGroup

Const ForReading = 1

' Specify Distinguished Name of new member (group or user).
strNewMember = "cn=MyList,ou=West,dc=MyDomain,dc=com:"

' Specify list of distribute group Distinguished Names.
strGroupList = "c:\Scripts\groups.txt"

' Bind to the new member object.
Set objNewMember = GetObject("LDAP://"; & strNewMember)

' Open the file of group names for read access.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objList = objFSO.OpenTextFile(strGroupList, ForReading)

' Read the list of Distinguished Names.
Do Until objList.AtEndOfStream
strGroup = Trim(objList.ReadLine)
' Skip blank lines.
If (strGroup <> "") Then
' Bind to the Distribution Group.
' Trap error if group not found.
On Error Resume Next
Set objGroup = GetObject("LDAP://"; & strGroup)
If (Err.Number <> 0) Then
On Error GoTo 0
' Check if specified group already a member
' of this distribution group.
If (objGroup.IsMember(objNewMember.AdsPath) = False) Then
' Not a member, add to group.
objGroup.Add(objNewMember.AdsPath)
End If
Else
On Error GoTo 0
Wscript.Echo strGroup & " not found"
End If
End If
Loop

' Clean up.
objList.Close
=======
This can still be done if the list of distribution group names is the
"pre-Windows 2000 logon" names, but the script would require a few more
steps. You would use the NameTranslate object to convert the "pre-Windows
2000" names into Distinguished Names. You could also code a VBScript program
to spit out the Distinguished Names of all Distribution groups in the domain
(or in an OU) and echo the output to a text file to create the list. That
script would use ADO to retrieve the names. For information on using
NameTranslate in VBScript see this link:

http://www.rlmueller.net/NameTranslateFAQ.htm

For information on using ADO in VBScript see this link:

http://www.rlmueller.net/ADOSearchTips.htm

Using the syntax from this last link, the filter for all distribution groups
would be:

strFilter = "(&(objectCategory=group)" _
& "(!groupType:1.2.840.113556.1.4.803:=2147483648))"

That is also the filter that would be used in any command line utilities to
retrieve Distinguished Names, like dsquery or adfind.

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


.



Relevant Pages

  • Re: SBS 2003
    ... "I assume that you want to create a Distribution ... > List in Outlook, so when users can send emails and faxes at the same time ... Create a new Contact public folder under All Public Folders list. ... > distribution lists directly in Fax wizard. ...
    (microsoft.public.windows.server.sbs)
  • Re: Management of Contacts in Outlook
    ... > If a contact is a member of more than one distribution ... > list will any changes be propogated to ALL lists by ... >>>>Outlook does not use groups. ...
    (microsoft.public.outlook.contacts)
  • Re: Migrate Distribution Lists from 5.5 to 2003
    ... So i'm a little confused do you mean the Distribution Groups do exist in the ... And you can't change them to Distribution lists? ... Microsoft Exchange ... > Exchange 2003 server. ...
    (microsoft.public.exchange.setup)
  • Re: Fastcode Sort B&V version 0.8
    ... > Concrete here with log distribution, ... >> In making the benchmark we should just care about realism, ... >> algorithms on purpose doesn't make sense for a benchmark. ... implementations do get realistic worst cases (namely the sorted lists). ...
    (borland.public.delphi.language.basm)
  • Re: Management of Contacts in Outlook
    ... If a contact is a member of more than one distribution ... list will any changes be propogated to ALL lists by ... Does it not always note changes made to contact ...
    (microsoft.public.outlook.contacts)

Loading