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

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?
 
J

Joe Richards [MVP]

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
 
R

rwh

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top