Solved

Modify Expansion Server for large amount of Distribution Lists

Posted on 2004-09-01
11
1,657 Views
Last Modified: 2012-06-27

I need to modify the expansion server attribute on 900 distribution lists ... I've been trying to get the syntax correct and use LDIFDE but it doesn't seem to work ..

The import shows successful on my test but when I check the attribute on the DL it shows blank, instead of showing the old server name or "Expand on any server in the org" ...

The syntax I'm using is as follows:

dn: CN=ExpansionTest,OU=Users,OU=Accounts,DC=corp,DC=contoso,DC=com
changetype: modify
replace: msExchExpansionServerName
msExchExpansionServerName: CN=<ServerName>,OU=Applications,OU=Resources,DC=corp,DC=contoso,DC=com
-



CN=<ServerName>,OU=Applications,OU=Resources,DC=corp,DC=contoso,DC=com = the Distinguished Name of the new expansion server ... I've verified, even cut and pasted the direct DN's from ADSI ... no spaces ...

Anyone familiar enough with LDIFDE to understand what I'm doing wrong ... or know of a better way to mass change the expansion servers for a list of DL's?
0
Comment
Question by:BNettles73
  • 6
  • 5
11 Comments
 
LVL 22

Expert Comment

by:kristinaw
ID: 11956697
it would be really easy to write a little vbscript to do it.

are all the DL's in the same OU, by any chance, or do they all have the same 'old' server in that attribute?

kris.
0
 
LVL 12

Author Comment

by:BNettles73
ID: 11956920
Unfortunately the DL's are not all in the same OU, but I'm not opposed to moving them if it means an easier way to modify the expansion server attribute. The servers have three different possibilities for expansion servers, not excluding some which were configured improperly to expand on any server in the org ...

It's been years since I wrote any VBScript ... if you have any code I'd definitely give it a shot ...
0
 
LVL 22

Expert Comment

by:kristinaw
ID: 11956964
it would be easiest if they were all in the same OU, especially since I don't know you're environment.

i can write something generic based on a top level ou. easy enough to add a few extra "ou=" lines if it's not a top level OU.

give me a few minutes...

kris.
0
 
LVL 22

Accepted Solution

by:
kristinaw earned 500 total points
ID: 11957207
Set objOU                   = GetObject("LDAP://ou=Groups,dc=domain,dc=com")

For Each objGroup In objOU
      If objGroup.Class = "group" then      ' Filter the Domain Object/Collection to modify groups only
            objGroup.msExchExpansionServerName = "/O=ORGANIZATION/OU=SITE/cn=Configuration/cn=Servers/cn=MAIL"
            'objGroup.SetInfo
            'wscript.Echo objGroup.msExchExpansionServerName
      End If
Next

set objOU                   = Nothing
wscript.Echo "All Done"


here ya go. remove the ' at the beginning of the wscript.Echo line and all it will do is Echo the attribute that's already there. As long as the ' is in front of the setinfo line, it won't make any changes. remove it and the changes will become permanent when you run the script.

you could make a test OU, put one DL in there that already has the proper expansion server name, run the script and record what it echoes, change the commented line to match your values (and the set objou line to match the OU and your domain), then run a few tests.

should work like a charm. let me know if it you have any probs with it and i'll help you work them out.

cheers,
kris.
0
 
LVL 12

Author Comment

by:BNettles73
ID: 11957230
Lets assume they are all in the same OU ...

CN=DistributionList,OU=Users,OU=Accounts,DC=corp,DC=contoso,DC=com

and I need to set the expansion server to

CN=<ServerName>,OU=Applications,OU=Resources,DC=corp,DC=contoso,DC=com


how difficult would it be to have the script pull from another text file which only contained the DL names or at least the distinguished name of the DL? I appreciate any help you give me with this!!

Thanks!
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 12

Author Comment

by:BNettles73
ID: 11957237
doh! You just posted :) Thanks ... I'll give it a shot ..
0
 
LVL 22

Expert Comment

by:kristinaw
ID: 11957262
also, looks like the expansion server name is in the format i listed. maybe that's why it's erroring out on you with LDIFDE?
0
 
LVL 12

Author Comment

by:BNettles73
ID: 11957370


In my test environment I have the following .. am I missing something?  It runs without error but still hasn't changed the attribute ...




Set objOU                = GetObject("LDAP://ou=Distribution Lists,ou=Accounts,dc=corp,dc=tccirg,dc=com")

For Each objGroup In objOU
     If objGroup.Class = "group" then     ' Filter the Domain Object/Collection to modify groups only
          objGroup.msExchExpansionServerName = "/O=Trammell Crow/OU=TC/cn=Configuration/cn=Servers/cn=MDK01UMB01"
          'objGroup.SetInfo
          'wscript.Echo objGroup.msExchExpansionServerName
     End If
Next

set objOU                = Nothing
wscript.Echo "All Done"
0
 
LVL 22

Expert Comment

by:kristinaw
ID: 11957418
as long as the objGroup.SetInfo has the ' in front of it, it won't change the attribute. you have to take the apostrophe away for it to actually change it.

Kris.
0
 
LVL 12

Author Comment

by:BNettles73
ID: 11957507
hehe ummm sorry .... I wasn't paying attention! The script works like a charm!
0
 
LVL 22

Expert Comment

by:kristinaw
ID: 11957646
cool. gifts of appreciation are always welcome ;).
0

Featured Post

Do email signature updates give you a headache?

Are you constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

Question has a verified solution.

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

914 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

19 Experts available now in Live!

Get 1:1 Help Now