Google
Search WWW Search msexchangetips.blogspot.com

Tuesday, August 07, 2007

Active Directory: Copy Distribution List Members to Another Distribution List

Summary: In this example, we will copy all members from one Distribution Group to another Distribution Group.

Copy the contents below and save as copymembers.vbs to C: drive


Const ADS_GROUP_TYPE_GLOBAL_GROUP = &H2

Set objOU = GetObject("LDAP://OU=Security Groups, dc=company, dc=com")
Set objOldGroup = GetObject("LDAP://CN=mysourcegroup, ou=security groups, dc=company, dc=com")
Set objNewGroup = GetObject("LDAP://CN=mytargetgroup, ou=security groups, dc=company, dc=com")

On Error Resume Next
For Each objUser in objOldGroup.Member
objNewGroup.Add "LDAP://" & objUser
Next


Open Command prompt:

C:\>cscript copymembers.vbs


The script will copy all members in the "mysourcegroup" Distribution List to your "mytargetgroup" Distribution List.


Note: Some organizations like to use # in front of their Distribution List names so they appear together in the GAL. Because this is a special character it will need to be in double quotes to treat # as a literal.

Example:
("LDAP://""CN=mysourcegroup""


James Chong (MVP)MCSE M+, S+, MCTS, Security+
msexchangetips.blogspot.com

How useful was this article? Want to see a tip not listed? Please leave a comment.

33 Comments:

Blogger Support said...

Hi

This article is good and informative.

yours truly,
bookoftips.blogspot.com

1:09 AM  
Anonymous Anonymous said...

I love you!!

You saved me hours and hours...
Keep up the good work, I have your blog in my Bookmarks and come back to it constantly

8:52 AM  
Blogger madhavan said...

Really useful info, it worked and saved lot of time for me.

Thanks a lot.

Regards,
Maddy

4:16 AM  
Anonymous Anonymous said...

Thanks a bunch! Exactly the quick script our organization was seeking.

1:34 PM  
Anonymous Anonymous said...

Thanks a bunch! Exactly the quick script our organization was seeking.

1:35 PM  
Blogger Robert said...

Thank you for posting this!!!!

6:11 AM  
Blogger David said...

I'm not able to get the script to work. Not enough information. Need an exampl.

8:17 AM  
Blogger Mick Tripps said...

I changed "mysourcegroup" and "mytargetgroup" to the correct group names, but the script fails with this error. What did I miss? Does the script have to be run from the Exchange server? Do any other values in the example have to be changed? Thank you.

--

C:\>cscript copy_group.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

C:\copy_group.vbs(3, 1) (null): A referral was returned from the server.

10:40 AM  
Anonymous Martijn said...

This article has saved me alot of time. Thanks!

2:40 AM  
Anonymous KeithL said...

I tried the scrip and it runs without error, but does not populate the target group. My groups are universal groups, I am wondering if that matters?

8:02 AM  
Anonymous Anonymous said...

I think 2moons dil changes my life. Because of 2moons gold, I meet a lot of friends. Besides, my friends usually give me some 2moon dil. I usually buy 2moons dil through Internet and advice from my friends, so I gain a lot of cheap 2moons gold and harvest in life.

9Dragons is a very good game. Through buying 9Dragons gold, I find fun in it. I am so glad that I can earn a lot of 9 Dragons gold. 9Dragons cater to the taste of young people. With cheap 9Dragons gold, you can get everything you want in this game. So I like to buy 9 Dragons gold. For me 9Dragons money is not just a simple thing.

7:44 PM  
Anonymous cheap rappelz rupees said...

I like play online game, I also buy ragnarok online zeny and ro zeny, the ragnarok zeny is very cheap, and use the iro zeny can buy many things, I like cheap zeny, thanks, it is very good.

I like play online game, I also buy rupees and rappelz rupees, the rappelz gold is very cheap, and use the rappelz money can buy many things, I like cheap rappelz rupees, thanks, it is very good.

6:08 PM  
Anonymous Anonymous said...

Thanks.. It works amazing.. awesome

2:54 PM  
Anonymous Anonymous said...

Thanks for the script, managed to get it working after lots of trial & error.

Seems the script is very fussy on upper / lower case characters. Also had to create the new distribution list and put it into the correct OU before it would work, and had to make sure that both old and new DL's were global not universal.

Hope that helps somebody.

7:44 AM  
Anonymous Anonymous said...

Thank you so much - you saved my day! :-)

May it is helpful to use add. the MS-Tool ldp (Server support tools) it helps you figure out the right LDAP path information, I had trouble with them first ;-).

Clear, straight forward help as needed. - Thank you!

Catta

9:00 AM  
Blogger 123 123 said...

Interesting article you got here. I'd like to read a bit more about this matter. Thnx for posting that info.
Sexy Lady
Blonde escort

6:23 AM  
Anonymous Anonymous said...

Capooooooo!!!

Groso!!!

Master!!!

God!!!

Salvator!!!

Thanks from Argentina
C. Castagnola!!!

1:47 PM  
Anonymous Anonymous said...

The Hogan scarpe
brand is distinctive for high quality. Hogan scarpe donna
are the highest expression of a new luxury lifestyle. hogan donna
is meant for someone who cherishes the type of luxury associated. Apparently Ben had extra spikes put in his Hogan scarpe uomo
for extra grip.

6:20 PM  
Anonymous Tech solution said...

Thanks for the solution, it works fine

10:53 PM  
Anonymous Anonymous said...

working brilliant
thank you

9:29 AM  
Blogger oakleyses said...

louis vuitton outlet, oakley sunglasses, michael kors handbags, cheap jordans, prada handbags, uggs outlet, michael kors outlet, oakley sunglasses, uggs on sale, ray ban sunglasses, burberry outlet, tiffany jewelry, uggs on sale, kate spade, gucci handbags, ray ban sunglasses, prada outlet, longchamp outlet, louboutin uk, burberry factory outlet, tory burch outlet, nike air max, tiffany jewelry, christian louboutin, louboutin shoes, oakley sunglasses, cheap oakley sunglasses, chanel handbags, michael kors outlet store, louis vuitton outlet, nike outlet, ralph lauren polo, louis vuitton, christian louboutin, michael kors outlet online, longchamp outlet, uggs outlet, michael kors outlet online, nike air max, longchamp bags, replica watches, ralph lauren outlet, oakley sunglasses, ray ban sunglasses, louis vuitton outlet online, nike free, michael kors

6:40 PM  
Blogger oakleyses said...

burberry pas cher, lunette oakley pas cher, coach outlet, kate spade outlet, true religion jeans, converse, coach outlet, longchamp soldes, north face uk, michael kors, louboutin pas cher, new balance, lululemon outlet, coach purses, nike air max, hermes pas cher, nike tn pas cher, vans pas cher, coach outlet store online, mulberry uk, lunette ray ban pas cher, nike air max uk, sac guess pas cher, nike air force, nike roshe run pas cher, longchamp pas cher, north face pas cher, nike air max pas cher, ray ban uk, true religion outlet, abercrombie and fitch, polo lacoste pas cher, true religion outlet, michael kors, jordan pas cher, nike free, polo ralph lauren uk, vanessa bruno pas cher, true religion outlet, hogan sito ufficiale, ralph lauren pas cher, michael kors outlet online, nike free pas cher, nike roshe uk, abercrombie and fitch UK, nike blazer pas cher, hollister uk

6:42 PM  
Blogger oakleyses said...

converse shoes outlet, salvatore ferragamo, timberland boots, softball bats, herve leger, ray ban, hollister, louboutin, gucci, nike roshe run, iphone cases, beats by dre, mcm handbags, oakley, p90x workout, insanity workout, wedding dresses, abercrombie and fitch, abercrombie, nike air max, mac cosmetics, babyliss pro, valentino shoes, bottega veneta, mont blanc, converse, jimmy choo outlet, hollister clothing, nike air max, north face outlet, new balance shoes, north face outlet, instyler ionic styler, soccer shoes, lululemon outlet, asics running shoes, ghd hair, giuseppe zanotti, soccer jerseys, nfl jerseys, longchamp uk, reebok outlet, nike air huarache, chi flat iron, hermes handbags, vans outlet, polo ralph lauren, celine handbags, nike trainers uk, vans scarpe

6:45 PM  
Blogger oakleyses said...

toms shoes, supra shoes, montre pas cher, ugg uk, juicy couture outlet, moncler, lancel, michael kors outlet online, ugg pas cher, michael kors handbags, barbour, doke & gabbana, michael kors outlet, coach outlet, louis vuitton uk, canada goose jackets, pandora charms, moncler, ugg,ugg australia,ugg italia, links of london uk, moncler jackets, hollister, juicy couture outlet, canada goose outlet, swarovski uk, pandora jewelry, canada goose pas cher, canada goose outlet, marc jacobs, moncler pas cher, thomas sabo uk, swarovski jewelry, karen millen uk, louis vuitton, moncler, moncler uk, sac louis vuitton, canada goose, moncler outlet, louis vuitton, canada goose, wedding dresses uk, ugg,uggs,uggs canada, canada goose uk, sac louis vuitton, moncler, replica watches, barbour jackets uk, bottes ugg pas cher, canada goose jackets

6:50 PM  
Blogger Minko Chen said...

true religion jeans sale
mlb jerseys
cheap jordan shoes
michael kors uk
michael kors outlet
coach outlet store
louis vuitton outlet store
lacoste pas cher
michael kors handbags wholesale
coach outlet online
michael kors outlet
true religion outlet
cheap ugg boots
michael kors handbags
rolex watches,rolex watches,swiss watches,watches for men,watches for women,omega watches,replica watches,rolex watches for sale,rolex replica,rolex watch,cartier watches,rolex submariner,fake rolex,rolex replica watches,replica rolex
oakley sunglasses
cheap ray ban sunglasses
longchamp handbags outlet
giuseppe zanotti outlet
hermes birkin bag

6:52 PM  
Blogger xumeiqing said...

151202meiqing
oakley sunglasses wholesale
michael kors outlet
michael kors handbags
true religion
lebron james shoes
ugg outlet store
louis vuitton outlet
louis vuitton handbags
ray ban sunglasses outlet
celine
montblanc
canada goose jackets
coach factory outlet
michael kors outlet stores
uggs clearance sale outlet
ray ban sunglasses outlet
ugg boots on sale
ugg outlet
toms shoes
louis vuitton outlet stores
ugg boots
toms
ugg boots
abercrombie
cheap jordans
marc jacobs
cheap nfl jerseys
north face jacket
coach factory outlet
tory burch outlet
canada goose outlet
ray ban sunglasses
tods shoes
timberland boots
louboutin pas cher
uggs clearance
michaek kors outlet
coach outlet online
cheap oakleys
ugg outlet

5:36 PM  
Blogger 小 Gg said...

mont blanc
michael kors outlet sale
moncler coats
canada goose outlet
rolex watches
uggs outlet
nfl jerseys wholesale
ed hardy outlet
louis vuitton outlet store
coach outlet
michael kors handbags,michael kors outlet,michael kors outlet online,michael kors,kors outlet,michael kors outlet online sale,michael kors handbags clearance,michael kors purses,michaelkors.com,michael kors bags,michael kors shoes,michaelkors,cheap michael kors
ray ban sunglasses
nike air huarache,nike huarache,nike huarache sneakers,nike huarache shoes
winter jackets outlet
polo ralph lauren
lebron james shoes,lebron 12,lebron 12 shoes,lebron sneakers,lebron iv,lebron 11,lebron 10
nike air foamposite one,foamposite,foamposites,foamposite release 2015,foamposite sneakers,foamposites for sale,foamposite gold
michael kors uk outlet
nike running shoes
canada goose jackets
cheap ugg boots
cyber monday
oakley
oakley sunglasses
mlb jerseys wholesale
cheng1202

12:03 AM  
Blogger John said...

coach outlet online
louboutin pas cher
cheap oakley sunglasses
ugg boots on sale
the north face outlet
nike air force 1
ugg boots
michael kors outlet online
beats by dre
ralph lauren outlet
canada goose
coach outlet online
chanel handbags
michael kors handbags
louis vuitton outlet stores
canada goose outlet
cheap jordans
uggs outlet
michael kors handbags
louis vuitton handbags
louis vuitton outlet
coach factory outlet
abercrombie & fitch
uggs on sale
oakley sunglasses wholesale
polo ralph lauren
michael kors outlet online
cheap soccer shoes
coach outlet store online
20151203yuanyuan

7:16 PM  
Blogger 小 Gg said...

mont blanc
michael kors outlet sale
moncler coats
canada goose outlet
rolex watches
uggs outlet
nfl jerseys wholesale
ed hardy outlet
louis vuitton outlet store
coach outlet
michael kors handbags,michael kors outlet,michael kors outlet online,michael kors,kors outlet,michael kors outlet online sale,michael kors handbags clearance,michael kors purses,michaelkors.com,michael kors bags,michael kors shoes,michaelkors,cheap michael kors
ray ban sunglasses
nike air huarache,nike huarache,nike huarache sneakers,nike huarache shoes
winter jackets outlet
polo ralph lauren
lebron james shoes,lebron 12,lebron 12 shoes,lebron sneakers,lebron iv,lebron 11,lebron 10
nike air foamposite one,foamposite,foamposites,foamposite release 2015,foamposite sneakers,foamposites for sale,foamposite gold
michael kors uk outlet
nike running shoes
canada goose jackets
cheap ugg boots
cyber monday
oakley
oakley sunglasses
mlb jerseys wholesale
cheng1203

1:50 AM  
Blogger xumeiqing said...

151210meiqing
nike air max
prada uk
cheap oakleys
jordan shoes
ugg slippers
coach factory outlet
louis vuitton purses
louis vuitton
fitflops sale clearance
instyler curling iron
louis vuitton outlet
polo ralph lauren
michael kors outlet
air jordan retro
gucci outlet
jordan 11
timberland boots
oakley sunglasses
coach outlet
jordans for sale
michaek kors outlet
michael kors
coach outlet store online
hollister uk
jordan concords
coach outlet
uggs sale
michael kors handbags
cheap soccer shoes
louis vuitton
abercrombie
jordan retro
michael kors outlet clearance
louis vuitton outlet
uggs clearance sale outlet
oakley sunglasses
michael kors outlet online
louis vuitton
cheap uggs
ray-ban sunglasses

6:16 PM  
Blogger 艾丰 said...

jianbin1217
fitflops shoes
fitflops sale
fitflops sale clearance
fitflops sale
fitflops shoes
michael kors outlet
michael kors outlet
michael kors outlet
tiffany and co
tiffany jewellery
beats by dr dre
beats by dre
oakley sunglasses
oakley sunglasses
ray-ban sunglasses
ray ban sunglasses
hollister uk
lululemon outlet
ugg outlet
ugg boots
ugg boots
rolex watches
mulberry handbags
mulberry bags
mulberry outlet
mulberry sale
mulberry handbags
mulberry handbags
louis vuitton handbags
louis vuitton handbags
toms shoes
omega watches
ferragamo shoes

6:58 PM  
Blogger Chen Jeje said...

michael kors outlet store
tiffany jewelry
jordan retro
fitflops
jordan shoes on sale
http://www.outlettiffanyand.co
christian louboutin outlet
michael kors outlet
air huarache shoes
michael kors handbags outlet
nfl jerseys
fitflops clearance
cheap tiffanys
nike zoom kobe
michael kors handbags,michael kors handbags clearance,michael kors clearance
michael kors outlet
michael kors outlet store
michael kors handbags
fitflops clearance
ray ban sunglasses outlet

7:23 PM  
Blogger chenlina said...

oakley sunglasses
longchamp bags
hermes bag
toms shoes
jordans
jordan 8s
ralph lauren polo
jordan concords
michael kors outlet
adidas shoes
michael kors outlet
michael kors handbags
jordan retro
nike roshe run
toms
louis vuitton handbags
cheap jordan shoes
jordan shoes
michael kors outlet clearance
coach factory outlet
adidas ultra boost
christian louboutin sale
nike air max 90
louis vuitton outlet
louis vuitton bags
abercrombie and fitch
michael kors outlet online
burberry outlet
nike factory outlet
polo ralph lauren
coach outlet online
adidas uk
air jordans
fitflop sandals
kobe 11 shoes
michael kors outlet online sale
coach outlet
ray ban sunglasses
michael kors canada
juicy couture
chenlina20160803

5:47 PM  

Post a Comment

<< Home

xml:lang="en" lang="en"> MS Exchange Tips: Active Directory: Copy Distribution List Members to Another Distribution List