Add Exchange "Contacts" to a Distirbution List with batch script?

  • Thread starter Thread starter rwh
  • Start date Start date
R

rwh

This hope someone in here may know how to do this.

I have several "Contacts" setup in an OU in AD. I also have a Global
Distribution List setup.
I want to srcipt adding those contacts to the DL.
I know how to add users but I can't seem to add contacts.

This is how I add users with a batch script
net group DL User /ADD /DOMAIN

But it doesn't work when using the Alias or Display name of a contact

Anyone have a clue on how to do this with a batch script?
 
You can't manipulate contacts with legacy API tools like NET because contacts
don't have a sAMAccountName which is what it focuses on.

You will need to use LDAP tools or ADSI scripts.


You will need to do something like

admod -b groupdn member:+:contactDN

or alternatively

admod -b groupdn member:++:contactdn;contact2dn;contact3dn

etc.

If you have XP clients or 2003 servers you also have dsmod from MS available to
you.

joe
 
Thanks, I figured out how to do it with the dsmod utility per your
suggestion

dsmod group "cn=GROUPNAME,ou=GROUPS,dc=mydomain,dc=domain,dc=com"
-addmbr "CN=Conatct Name,OU=Contacts For
Lists,DC=mydomain,DC=domain,DC=com"

Line is meant to be 1 long string, Be careful of line wrap.
 
Back
Top