header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Modify Expansion Server for large amount of Distribution Lists
Last Post 21 Jul 2008 03:43 PM by Reda01. 17 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Reda01User is Offline
New Member
New Member
Posts:19

--
20 Jun 2008 10:47 AM  

Hello,

I need to modify the expansion server attribute on 900 distribution lists, Exchange server 2003 SP2. I am trying to change the option msExchExpansionServerName to " Any server in the organization" instead of  server which has been removed from our AD.

When I execute this VB script :

==

Set objOU = GetObject("LDAP://OU=NameOfDL,OU=OU1,OU=OU2,OU=SITE,DC=DC1,DC=CONTOSO,DC=COM")

For Each objGroup In objOU
    ' Filter the Domain Object/Collection to modify groups only
      If objGroup.Class = "group" then      
            objGroup.msExchExpansionServerName = "/O=EBU/OU=GVA/cn=Configuration/cn=Servers/cn=Any server in the organization"
            objGroup.SetInfo
            wscript.Echo objGroup.msExchExpansionServerName
      End If
Next

set objOU = Nothing
wscript.Echo "All Done"

===

This script runs successfully, but it didn't modify anything, the Distribution groups still point to removed server. The option Expansion Server must be set to " Any server in the organization ".

I made many researches how to do it in PowerShell, wihtout success.

Would it be possible to do it in PowerShell ? Or any ideas why the vb script doesn't modify the option ?

Thank you,

Reda

 

halr9000User is Offline
Basic Member
Basic Member
Posts:316

--
20 Jun 2008 01:49 PM  
I suggest you check out Quests's AD Cmdlets. They make it very easy to manipulate AD attributes. You can find them at quest.com/powershell.
Reda01User is Offline
New Member
New Member
Posts:19

--
20 Jun 2008 02:05 PM  
Hi,

Thanks I will try this.

Reda
Reda01User is Offline
New Member
New Member
Posts:19

--
08 Jul 2008 01:49 PM  
Hello,

I spent hours looking after how to modify many distribution lists expansion server option to " any server in the organization " with VBScript or Quest commandlets for Exchange 2003, without success.

Would anyone have any ideas how to do it using powershell ?

Thanks in advance,
Reda
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
08 Jul 2008 04:08 PM  
I believe msExchExpansionServerName is linked with HomeMTA in ADUC. If HomeMTA is not changed I do not think you will see the change in the GUI. Have you queried for the value after you set it?
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
08 Jul 2008 04:22 PM  
Ok.... here is another problem.

If you want to make it "Any server in the organization" you need to clear the attribute. You do that like this

$objGroup.PutEx(1,'msExchExpansionServerName')
$objGroup.SetInfo()
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
08 Jul 2008 04:28 PM  
See http://technet.microsoft.com/en-us/library/aa996429(EXCHG.65).aspx for more info
Reda01User is Offline
New Member
New Member
Posts:19

--
09 Jul 2008 04:49 PM  
Hi bsonposh,

Thank you for your help. I've just test it, but the script runs with errors :

My script is :

----------
Set objOU = GetObject("LDAP://OU=testdl,OU=FromMSX55,OU=SITE,OU=ORG,DC=MAIL,DC=***,DC=***")

For Each objGroup In objOU
' Filter the Domain Object/Collection to modify groups only
If objGroup.Class = "group" then

objGroup.PutEx(1,'msExchExpansionServerName')
objGroup.SetInfo()

objGroup.msExchExpansionServerName ="/o=Any server in the organization"
objGroup.SetInfo
wscript.Echo objGroup.msExchExpansionServerName
End If
Next

set objOU = Nothing
wscript.Echo "All Done"
-----------

Do I need this two lines :

objGroup.msExchExpansionServerName ="/o=Any server in the organization"
objGroup.SetInfo

Thanks,

Reda
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
09 Jul 2008 05:40 PM  
No... remove those.
Reda01User is Offline
New Member
New Member
Posts:19

--
10 Jul 2008 01:30 PM  
Hello,

I removed the two lines, however it sill giving the error at this line :

objGroup.PutEx(1,'msExchExpansionServerName')

I verified the syntax in the document you gave the link. It seems to be correct but when I execute the script it doesn't run.

?

Thanks,

Reda
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
10 Jul 2008 02:52 PM  
what is the error?
Reda01User is Offline
New Member
New Member
Posts:19

--
10 Jul 2008 03:40 PM  
Hello,

It's a syntax error :

Line : 6 => which is : objGroup.PutEx(1,'msExchExpansionServerName')
Error : Syntax error
Code : 800A03EA

I tried without parenthesis, withiout spaces....
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
10 Jul 2008 03:51 PM  
ok... so there is a language translation issue here.

Your writing VBScript, I am writing Powershell :)

Try this.
objGroup.PutEx 1,'msExchExpansionServerName'
objGroup.SetInfo
Reda01User is Offline
New Member
New Member
Posts:19

--
10 Jul 2008 04:01 PM  
Hihi... I tought it wasn't possible to do it in PS.

The complete script I am executing is :

***
Set objOU = GetObject("LDAP://OU=testdl,OU=FromMSX55,OU=GVA,OU=EBU,DC=gva,DC=ebu,DC=ch")

For Each objGroup In objOU
' Filter the Domain Object/Collection to modify groups only
If objGroup.Class = "group" then
objGroup.PutEx 1,'msExchExpansionServerName'
objGroup.SetInf

wscript.Echo objGroup.msExchExpansionServerName
End If
Next

set objOU = Nothing
wscript.Echo "All Done"
***

I am still getting the same error as before :

Line : 6 => which is : objGroup.PutEx 1,'msExchExpansionServerName'
Error : Syntax error
Code : 800A03EA


As I said I modified many times the syntax but still the same error.....

Thank you.
bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
10 Jul 2008 04:21 PM  
You problem never had anything to do with Powershell... it was the way the problem was approached.

In the script you just posted
objGroup.SetInf should be objGroup.SetInfo

For vbscript try
objGroup.PutEx 1,'msExchExpansionServerName',vbnul

You can do this in Powershell like this

$group = [ADSI]"LDAP://OU=testdl,OU=FromMSX55,OU=GVA,OU=EBU,DC=gva,DC=ebu,DC=ch"
$group.PutEx('1','msExchExpansionServerName',$null)
$group.SetInfo()
Reda01User is Offline
New Member
New Member
Posts:19

--
10 Jul 2008 04:57 PM  
Hi Brandon,

Sorry for the confusion. In the beginning I wanted to do it in PS, afterward I understood that PS won't make it with Exchange 2003 as it was designed for 2007, so I wanted just to understand why this VB script doesn't run successfully.

I run the script with the modification you made objGroup.PutEx 1,'msExchExpansionServerName',vbnul ; It gave the same syntax error message. After modifying the line to :

objGroup.PutEx 1,"msExchExpansionServerName",vbnul

With " " the scripts run correctly without errors, however from the AD GUI vue I still don't get the entry " Any server in the organization " I still have the old server 5.5 we've already removed ??

Thank you for the PS script, it runs without errors but it doesn't make any changes ?

Am I doing something wrong ?

Thanks,

Reda


bsonposhUser is Offline
Basic Member
Basic Member
Posts:388

--
10 Jul 2008 05:01 PM  
Other than waiting for replication. You can verify by looking the msExchExpansionServerName attribute via LDP or ADSIEdit.msc
Reda01User is Offline
New Member
New Member
Posts:19

--
21 Jul 2008 03:43 PM  
Hi Brandon,

You're right, I see the modification in the ADSIEdit.msc but not in ADUC. I will make some tests to see what option the system takes in consideration ?

Thanky you very much for your help,

Reda
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer