Solved

Modify Expansion Server for large amount of Distribution Lists

Posted on 2004-09-01
11
1,647 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 12

Author Comment

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

Expert Comment

by:kristinaw
Comment Utility
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
Comment Utility


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
Comment Utility
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
Comment Utility
hehe ummm sorry .... I wasn't paying attention! The script works like a charm!
0
 
LVL 22

Expert Comment

by:kristinaw
Comment Utility
cool. gifts of appreciation are always welcome ;).
0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

Suggested Solutions

Easy CSR creation in Exchange 2007,2010 and 2013
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
To show how to create a transport rule 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 >> Rules tab.:  To cr…

743 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

17 Experts available now in Live!

Get 1:1 Help Now