Bulk change advanced properties of internet message format domains - Exchange 2003
In order to bulk enable the options "Allow out of office responses, Allow delivery reports, Allow non-delivery reports, Preserve senders display name on message" (as they are shown in the next figure) in the advanced tab in the properties of all domains you have listed in Internet Message Formats please proceed as follows:
Use ADSIEdit to export all distinguished names of the objects. To do so navigate to:
*** Configuration -> Services -> Microsoft Exchange -> Your Organization Name -> Global Settings -> Internet Message Formats
*** Right click on CN=Internet Message Formats and "Export List … "
Save this list as Tab Delimited txt file.
Open this file with Excel and delete the first row (name, class, distinguished name) and the first two columns (values for name and class).
After deletion ONLY the DNs should be in the file! Those should be all in the first column (A) starting from the first row (1):
Now for every domain we need to have value 25 for following attribute "msExchRoutingAcceptMessageType" which actually defines the settings on this options (see first figure). In order to find the right value, it is recommended to make the settings for one domain and to check the attribute using ADSIEdit.
In order to do so, for every domain the following syntax is needed:
dn: CN=a,CN=Internet Message Formats,CN=Global Settings,CN=Erste Organisation,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=timisoara,DC=lab
changetype: Modify
replace: msExchRoutingAcceptMessageType
msExchRoutingAcceptMessageType: 25
-
This can be achieved using a macro (vbs script) to insert these rows:
Sub insertrows()
[a1].Activate
' the script starts at cell A1
hasvalue = ActiveCell.Value
' uses the variable hasvalue to determine where to stop
Do While Not (hasvalue = "")
' it will stop where the next cell has no value
ActiveCell.Value = "dn: " + ActiveCell.Value
' to meet the neeed syntax dn: has to be added in front of the distinguished name
ActiveCell.Offset(1, 0).Select
' moving one cell down
Selection.Resize(rowsize:=1).Insert Shift:=xlDown
' inserting a new (first) row
ActiveCell.Value = "changetype: Modify"
' inserting the value in the first cell of this new row
ActiveCell.Offset(1, 0).Select
' moving one cell down
Selection.Resize(rowsize:=1).Insert Shift:=xlDown
' inserting a new (second) row
ActiveCell.Value = "replace: msExchRoutingAcceptMessageType"
' inserting the value in the first cell of this new row
ActiveCell.Offset(1, 0).Select
' moving one cell down
Selection.Resize(rowsize:=1).Insert Shift:=xlDown
' inserting a new (third) row
ActiveCell.Value = "msExchRoutingAcceptMessageType: 25"
' inserting the value in the first cell of this new row
ActiveCell.Offset(1, 0).Select
' moving one cell down
Selection.Resize(rowsize:=1).Insert Shift:=xlDown
' inserting a new (fourth) row
ActiveCell.Value = "-"
' inserting the value in the first cell of this new row
ActiveCell.Offset(1, 0).Select
' moving one cell down
Selection.Resize(rowsize:=1).Insert Shift:=xlDown
' inserting a new (fifth) row
ActiveCell.Value = ""
' inserting the value (actually an empty row) in the first cell of this new row
ActiveCell.Offset(1, 0).Select
' moving one cell down
hasvalue = ActiveCell.Value
' hasvalue is used to check if there is another row to loop
Loop
End Sub
Run the script, after which the excel sheet should look similar to the following figure:
Copy the first column by marking (click on top of the column A) and using CTRL+C. Paste everything into a txt file.
Import this file into the active directory (AD) using ldifde:
ldifde -i -f <text file name> -s <domain controller>
***************************************************************************