Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Script for creating mail enabled distribution lists.

Posted on 2008-10-14
5
Medium Priority
?
409 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

782 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