Every time I do an Exchange 2000/2003 to Exchange 2007 transition I have to run the same shell commands at the end to upgrade the default Email Address Policy, Address Lists, and Global Address List.

So I wrote this script to do it automatically.  To use the script copy this code into Notepad and save it as “upgradeobjects.ps1” somewhere on the Exchange server.

Set-EmailAddressPolicy "Default Policy" -IncludedRecipients AllRecipients -ForceUpgrade

Set-AddressList "All Users" -IncludedRecipients MailboxUsers -ForceUpgrade

Set-AddressList "All Groups" -IncludedRecipients MailGroups -ForceUpgrade

Set-AddressList "All Contacts" -IncludedRecipients MailContacts -ForceUpgrade

Set-AddressList "Public Folders" -RecipientFilter { RecipientType -eq 'PublicFolder' } -ForceUpgrade

Set-GlobalAddressList "Default Global Address List" -RecipientFilter {( Alias -ne $null -and (ObjectClass -eq 'user' -or ObjectClass -eq 'contact' -or ObjectClass -eq 'msExchSystemMailbox' -or ObjectClass -eq 'msExchDynamicDistributionList' -or ObjectClass -eq 'group' -or ObjectClass -eq 'publicFolder' ))} -ForceUpgrade

Then open the Exchange Management Shell, and execute the script.

Example:

C:tempupgradeobjects.ps1

There is nothing fancy in it like progress indicators or error handling, it just does what it needs to do and exits.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

Leave a Reply