Solved

Script for creating mail enabled distribution lists.

Posted on 2008-10-14
5
396 Views
Last Modified: 2012-05-05
Hello,

i'm cleaning up AD mail enabled security groups. I want to remove their Exchange attributes so they are no longer mail enabled. However I would like to create the same name and append _DL . This way all AD objects with _DL will be mail enabled Global Ditribution lists. The members have to be copied over.
For example:
We now have in AD the Group "IT Dept" which is a mail enabled Global Security Group. We have 10 users in the member field added. So someone can write to "IT Dept@domain.com" and the 10 members get the email.
I would like to change it to:                      
"IT Dept_DL" and make it a Mail enabled Global Distribution Group and have all the 10 users copied over.

Because I have about 100 groups to do is there a way to have a script running that will do this instead of me doing it manually?

Much appreciate the help,
Tacobell2000
0
Comment
Question by:Tacobell2000
  • 3
5 Comments
 
LVL 4

Expert Comment

by:every1isevil2
ID: 22713031
Are you using exchange 2003 or 2007?
with 2007,  you can create dynamic distribution lists.
0
 

Author Comment

by:Tacobell2000
ID: 22713170
Ooops forgot to mention that I am running Exchange 2003 on a Windows 2003
0
 
LVL 18

Expert Comment

by:sk_raja_raja
ID: 22713422
0
 

Author Comment

by:Tacobell2000
ID: 22715531
I simply do not know whether this post http://www.experts-exchange.com/Programming/Languages/Scripting/Q_23100630.html would be usefuill in my situation.
0
 

Accepted Solution

by:
Tacobell2000 earned 0 total points
ID: 22715930
@echo off
setlocal
 
set oldgroupdn=cn=it_test,ou=it Groups,dc=lab,dc=com
set newgroupdn=cn=it_test_DL,ou=it Groups,dc=lab,dc=com
 
dsadd group "%newgroupdn%" -secgrp no -scope g
dsget group "%oldgroupdn%" -members | dsmod group "%newgroupdn%" -addmbr

This one is working beautifully. The only thing is I have 187 groups to create. There must be a txt file i can create and put it into the script somewhere.
Where can i put the txt file in the script?

Tacobell2000
0

Join & Write a Comment

I'm sure that every Windows systems administrator has written, or at least used, a batch or VBS login script at some point in their career, whether it is to map network drives, install printers, or set some user preferences.  No more! With Window…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now