Solved

Script for creating mail enabled distribution lists.

Posted on 2008-10-14
5
402 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

734 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