Exchange 2007/2010 Interop

As someone in the middle of a transition between Exchange 2007 SP3 and Exchange 2010 SP1, I have to ask; MS Exchange Team, what were you smoking when you came up with the interoperability options here?

2003 to 2007 was pretty decent, you could deploy your 2007 CAS servers more-or-less directly in place of your 2003 OWA front-end servers and they would happily serve 2003 mailboxes up to people. Management tool interop was lacking a bit, but that was excusable as 2007 was, at least, a totally new set of tools based on .NET/Powershell and they generally wouldn’t let you do anything to a 2003 mailbox that would break it horribly.

With 2007 to 2010 though, you can’t do any of that. You have to keep your 2007 CAS and HT servers around because the 2010 ones won’t play nice with 2007 mailbox servers, but then the 2010 CAS servers can’t connect to 2007 mailboxes. Except they can, if you copy the 2007 binaries onto them. Except that only works if there isn’t a 2007 CAS server in the same AD site as the 2010 CAS server. So, short of creating new AD sites for all your 2010 mailbox servers you have to have at least one AD site with both 2010 & 2007 CAS servers, which works OK internally, but if you’re publishing to the internets (and who isn’t these days?) then you start to run into issues. There are various articles about this (like this one) but basically you have to create a new internet-facing DNS entry for the 2007 CAS, move the 2010 to the old internet-facing DNS name, change the ExternalURL value on the 2007 CAS to match the new DNS name, change the internal DNS so that there’s an entry for the new DNS name (because Exchange treats other AD sites as “External” as well), buy a new trusted SSL Certificate for the new DNS name (or wildcard it) and pray to God that you’re only publishing 2007 CAS servers from a single AD site; otherwise it gets so complicated that your brain will try and kill itself to escape.

If you think that sounds bad, then wait; it gets better! You can’t use the 2010 management tools (which are now 64-bit only – unless you enjoy Powershell Remoting) to manage 2007 mailboxes. Well that’s not entirely true, you can so some things, just not everything and it’s the same with using the 2007 tools on 2010 mailboxes. It’s all documented on The MSExchangeTeam Blog and it’s a huge mess – if your helpdesk staff (or whoever else manages your mailboxes day-to-day) aren’t really on the ball there’s a good chance you’ll run into problems while the 2007->2010 transition is in progress.

All this is in addition to all the subtle syntax changes they’ve made to a lot of the management Cmdlets so that things which were valid commands in 2007 don’t quite work properly in 2010; I’m looking at you, Import-ExchangeCertificate – let’s go from importing a CA-supplied .cer file to importing the binary contents of said file as a Byte Array supplied as a command line argument, because that’s much easier.

I really like Exchange – 2007 SP1 onwards was top-notch – and 2010 has some great new functionality, but they’ve really dropped the ball when it comes to installation, upgrading, migrating and transitioning.

Microsoft Visual Studio 2005 Premier Partner Edition

This is an old one, but I’ve only just managed to find a solution after searching on and off for several months; we’ve had a couple of machines that developed the problem but it was never really considered serious enough to put a lot of effort into solving.

Scenario: You have a machine with some element of SQL 2005 installed; be it simply the management tools or the full-on server with all the trimmings. This machine claims, via WSUS or Windows Update, that it needs Visual Studio 2005 SP1, but the install keeps failing. If you run the update manually, it keeps asking you for “Microsoft Visual Studio 2005 Premier Partner Edition ENU – Disk 1”. Browsing provides you with a filename “vs_setup.msi” but the only one you can find on your machine is part of the .NET Framework 3.5 and isn’t the one it’s looking for.

Solution: Point the installer to the “vs_setup.msi” file located in the “Tools” folder of your SQL 2005 install media.

Exchange 2010 Gotchas: Multiple Domains

If you install Exchange 2010 into a forest with multiple domains then you may come across this issue.

When you are trying to enumerate or move system mailboxes within your Exchange 2010 organisation, you will not typically get any results returned unless you use the -DomainController switch and specify a DC from the root domain as this is where Exchange creates most of the system mailboxes. Without the -DomainController switch, it will use a DC in your current domain, which won’t be able to see any accounts in its parent(s).

i.e. Get-MailboxDatabase | Get-Mailbox -DomainController <dcname.root.domain>

This will typically come up when trying to remove the first (i.e. default) mailbox database created when you installed your 2010 mailbox servers.

Exchange 2010 SP1 – A Warning

Please note that this issue also appears to also occur with Exchange 2010 SP2

Be warned; if you attempt to upgrade an Exchange 2010 RTM install to Exchange 2010 SP1 and you do not have the correct Powershell Execution Policy in place (and I’m not entirely sure what that is, it’s not documented anywhere obvious but it appears that Unrestricted works – although some have said that it doesn’t – and I can assure you that RemoteSigned doesn’t) it will not warn you, it will not avoid it, it will simply break halfway through the install and leave your server in a state whereby the Exchange binaries are all deleted, half your Windows services are disabled and all the Exchange cruft is still in the registry. The error is akin to the following:

The following error was generated when "$error.Clear();
& $RoleBinPath\ServiceControl.ps1 EnableServices Critical
" was run: "AuthorizationManager check failed.".

The only fix I’ve found for this, after sorting the Powershell Execution policy is to delete all the Exchange keys from HKLM\Software\Microsoft\Exchange and HKLM\Software\Microsoft\ExchangeServer, restart all the disabled services (IIS, WMI, Remote Registry, etc) then run the Exchange 2010 RTM “setup.com /M:RecoverServer”, wait for it to complete and then attempting the SP1 install again.

All I can say is thank god I didn’t test this on a server that happened to have the correct Execution Policy and then subsequently deploy it into production onto one that didn’t.

Update: Thanks to Martin for pointing me to http://support.microsoft.com/kb/981474 – it looks like it’s not so much what the Execution Policy is set to, but how it’s set. Seems like a really stupid oversight to me; surely Microsoft must have expected people to use GPOs to set Powershell Execution Policies – at the very least some detection logic in the installer to warn the user would be nice.

.NET Cleanup Tool

If, like me, you manage hundreds of Desktops and Servers, sooner or later you’re going to come across one with a completely broken .NET install that no amount of uninstalling, reinstalling, patching and fiddling will fix properly.

If this sounds familiar, then what you need is the .NET Framework Cleanup Tool, written by Aaron Stebner, formerly of Microsoft’s Developer Division setup team.

It will strip out any installable version of the .NET framework upto and including 4.x and, so far at least, it has always managed to fix my broken installs.

Usual caveats apply, see the original blog post for more details.

The selected task “{0}” no longer exists

Ever since my power supply blew up and took my system down rather unexpectedly, I’ve been getting an error message every time I open up Task Scheduler in Windows 7; specifically “The selected task “{0}” no longer exists”. I’ve looked all over the place for a solution, but the majority of them just consist of identifying and deleting the missing tasks from the file system, which isn’t ideal when you’ve got loads of built-in system tasks that probably do importantish things.

So, brain was engaged, files were examined and a solution was found:

  1. Run Task Scheduler (TS)
  2. When the error(s) appear, dismiss them
  3. Navigate to each folder and subfolder in turn until you get the error message. Note the folder name and any tasks that *do* display
  4. Exit TS
  5. Open Explorer and navigate to %windir%\system32\tasks\ and then down to the folder from #3
  6. Cut & Paste the files that *aren’t* displayed in TS to a temporary location (Make sure you Cut and not Copy)
  7. Re-open TS, dismiss any errors and navigate back to the folder from #3, which should now open without any errors
  8. Right-Click on the folder and choose “Import Task”
  9. Set the “File Type” selection to “All Files” and then select the file you cut in #6, then OK the imported task. Repeat for any other tasks in that folder
  10. Return to #3 until all folders have been checked and you should now be able to open TS without any errors and without having lost any tasks

Note: I found that several of the tasks that I had created myself had “lost” their scheduling information (No “Next Run” time) and I had to open them, make an arbitrary change to the “Trigger” settings and then re-save them to put them back on track again.

Update: Fuck it, the same problem has come back again – it’s obviously something more serious than a one-off file corruption.