Solved

Script for creating mail enabled distribution lists.

Posted on 2008-10-14
5
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

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…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
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…
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 …

623 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