Exchange Server 2007 Transition Script

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:\temp\upgradeobjects.ps1

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

About Paul Cunningham

Paul is a Microsoft Exchange Server specialist for one of Australia's largest companies, and is the Publisher of ExchangeServerPro.com. He is also an MCP, MCSA, MCSE, MCTS, and an MCITP for Exchange Server 2007/2010. Connect with Paul on Twitter, LinkedIn and Google+.

Leave a Comment

*