ManageScheduledTask.ps1 issue uninstalling Exchange

Today I encountered a strange issue when trying to decommission a DAG member, after properly removing it from the DAG as explained here, and checking services like address book generation server where hosted on one of the other DAG members.

I started the removal process from an elevated command prompt (using the GUI doesn’t work as it complains about the need to use setup.com, which I can’t since I’m using the GUI):

setup /m:uninstall

The output was the following:

Hmm. Without even looking at the Exchange setup log, I noticed there was something strange with the error message:

The term ‘C:\Program Files\Microsoft\Exchange Server\V14\Bin\ManageScheduledTask.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program.

As you probably know, all Exchange scripts are located in the Scripts folder, not the Bin folder.

I tried a quick and dirty fix, which was to copy the ManageScheduledTask.ps1 and ManageScheduledTask.strings files to the Bin folder, and again started setup /m:uninstall. This time, Exchange uninstalled nicely.

From experience, this isn’t expected behavior, but in case you encounter this problem in the field, you now know how you can easily work around this.

Update: I’ve seen identical issues when retrying an upgrade on Exchange 2010 SP1 to SP2. I think the problem is code-related (i.e. bug), as the uninstall part of the upgrade process should check for those files in “scripts”, not “bin”. Note that with case of the failing SP2 upgrade, the file EnterpriseServiceEndpoints.xml was also MIA (that one should be in bin). I worked around that by copying the file from the installation source.

This entry was posted in Exchange 2010 and tagged by Michel de Rooij. Bookmark the permalink.

About Michel de Rooij

I'm a Microsoft 365 Apps & Services MVP, with focus on Exchange Server, AzureAD, Microsoft 365 and with a PowerShell affection. I'm a consultant, publisher of EighTwOne, published author, and speaker. You can find me on Twitter, LinkedIn, Facebook.

7 thoughts on “ManageScheduledTask.ps1 issue uninstalling Exchange

  1. Wish I would have found this post earlier. This is exactly what I need to fix a botched install. I guess I found it hard to believe that Microsoft could not and did not test the uninstall. I did not copy the .xml file to bin as a result the uninstall did fail on Preparing Files but re-running the uninstall show that it is fully uninstalled anyway.

    Thanks

    Like

  2. Pingback: Exchange Server 2010 – Issues Uninstalling Exchange – OakIT

  3. Worked! I tried a quick and dirty fix, which was to copy the ManageScheduledTask.ps1 and ManageScheduledTask.strings files to the Bin folder, and again started setup /m:uninstall. This time, Exchange uninstalled nicely.

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.