Home > Exchange Server > Script: Set-Exchange2010Features.ps1 – Automated prerequisite installation for Exchange Server 2010

Script: Set-Exchange2010Features.ps1 – Automated prerequisite installation for Exchange Server 2010

Update: This version resolves two bugs and adds the Adobe PDF Filter Pack and Windows Update menu options.

A while ago, fellow Exchange MVP Anderson Patricio released a script to help automate some of the tasks required before installing Exchange 2010 on Server 2008 R2. While it’s fairly straightforward to do it manually, automating the tasks can help reduce errors and issues – especially for consultants who may install Exchange 2010 often. Not long after Anderson released his script, Paul Flaherty released a revised version Bhargav Shukla released a revised version that streamlined it a little and added some functionality. Now it’s my turn.

More of an exercise to learn a method in PowerShell than anything else, I took Paul’s version and added functionality to the script. Over time, that has increased exponentially, and has become the most popular script on this site.

While SP1 added the functionality to install the required Windows features, I find this method a little nicer, as some tasks can be performed in a more structure manner. This is handy if you’re building a bunch of servers and want a standardized, error-free installation. Tasks such as disabling IPv6, downloading the latest updates, installing required Windows features, etc. are now just a menu option away.

I’ll likely tweak this some more when I have more time. But I’ve used this to build probably a dozen Exchange 2010 boxes so far, and it’s worked well. I welcome any comments or suggestions.


Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.


I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.


v3.3 Set-Exchange2010Features.v3.3.zip

v3.2 Set-Exchange2010Features.v3.2.zip

v1.0 Set-Exchange2010Prereqs.zip


See the changelog for information on features added in each version

  1. October 29th, 2011 at 16:53 | #1

    I have a quick question for you. I am installing MS Exchange 2010 on a MS Server 2008 R2 box (GoDaddy Virtual Dedicated Server) and I have been getting an error I can’t seem to solve. So, I ran your script – number by number (except 7 because I ran 6) and I am still getting the same error. Here is the summary when I tried to install:


    Summary: 6 item(s). 3 succeeded, 1 failed.
    Elapsed time: 00:00:31

    Configuring Prerequisites

    Elapsed Time: 00:00:01

    Organization Prerequisites

    Setup is going to prepare the organization for Exchange 2010 by using ‘Setup /PrepareAD’. No Exchange 2007 server roles have been detected in this topology. After this operation, you will not be able to install any Exchange 2003 or Exchange 2007 servers.

    Elapsed Time: 00:00:12

    Languages Prerequisites

    Elapsed Time: 00:00:03

    Hub Transport Role Prerequisites

    There was a problem accessing the registry on this computer. This may happen if the Remote Registry service is not running. It may also indicate a network problem or that the TCP/IP Netbios Helper service is not running.
    Click here for help… http://technet.microsoft.com/en-US/library/ms.exch.err.default(EXCHG.141).aspx?v=

    Installing Exchange Server on a domain controller will elevate the privileges for Exchange Trusted Subsystem to domain administrators.

    Elapsed Time: 00:00:07

    Client Access Role Prerequisites

    Elapsed Time: 00:00:05

    Mailbox Role Prerequisites


    Any help would be HUGH. I am stumped.


    • Pat Richard
      October 31st, 2011 at 20:56 | #2

      I’m assuming that you’ve verified those services are running? And you’re running the installer as an admin?

  2. Barren
    December 15th, 2011 at 06:38 | #3

    This is excellent stuff and has saved vast amounts of time when building up test and live systems consistently thankyou. I wonder if you are able to update this to include the additional prerequisites as required by Service Pack 2 please? (I’m bound to make a mistake if I do it lol). Thanks again.

    • Pat Richard
      December 16th, 2011 at 16:13 | #4

      It’s on the list!

  3. chad markley
    December 22nd, 2011 at 18:55 | #5

    Great job dude!! Saved me a bunch of time. Best script I’ve seen like it

  4. Pete
    December 28th, 2011 at 12:56 | #6

    Great Job on the script.
    Just an fyi, I used the latest version 3.2 and it did not add the asp.net and ISAPI filters on a CAS only install.

    • Pat Richard
      December 30th, 2011 at 00:57 | #7

      Thanks for pointing this out. I’ve released a new version that resolves this.

  5. March 27th, 2012 at 08:36 | #8

    Thanks for this script. This makes building test labs so much easier. I’m starting on a new Exchange 2010 project and plan on building and flattening my lab quite a few times. This will save me a bunch of time!

    • Pat Richard
      March 27th, 2012 at 08:43 | #9

      Not only lab servers, but production servers as well. Last week, I deployed 52 servers in two days using a modified version of it. You get quick, repeatable results.

  6. Chad D
    April 25th, 2012 at 20:03 | #10

    So would option 11 be the best one to run for a typical exchange 2010 install? This install I speak of is also part of exchange 2003 transition, if that makes any difference.

    • Pat Richard
      April 26th, 2012 at 09:28 | #11

      Which option is best is an organizational choice. But option 11 is the option I use the most.

  7. Alan Lowe
    July 26th, 2012 at 12:14 | #12

    Brotha this script set was amazing, ty so much for taking the time to save me a ton of time. I hope that you have a wonderful day.

  8. Steve
    August 9th, 2012 at 01:27 | #13

    I had errors occur when trying to deploy the filter pack Step 11

    File: PDFFilter64installer.msi doesn’t exist, unzipping…You cannot call a method on a null-valued expression.
    At C:\temp\Set-Exchange2010Features.ps1:217 char:31 $item = $zipfolder.parsename (“$target”) + CategoryInfo : InvalidOperation: (parsename:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull

    Remove-Item : Cannot find path ‘C:\Install\PDFiFilter64installer.zip’ because it does not exist.
    At C:\temp\Set-Exchange2010Features.ps1:222 char:14 Remove-Item <<<< $source
    + CategoryInfo : ObjectNotFound: (C:\Install\PDFiFilter64installer.zip:String) [Remove-Item], ItemNotFoundException FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

    File: PDFFilter64installer.msi installing…The term '.\PDFFilter64installer.msi' is not recognized as the name of a cmdlet, function, script file, or operable pro
    gram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:27
    + .\PDFFilter64installer.msi <<<< /quiet /norestart /l* c:\Install\PDFiFilter64Installer.log
    + CategoryInfo : ObjectNotFound: (.\PDFFilter64installer.msi:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    I went and downloaded pdffilter64installer.msi from the adobe website and placed in c:\install but still got the same errors – this PC doesn't have internet access as I was keeping it isolated until I was ready to install

  9. August 15th, 2012 at 15:07 | #14

    Please take a look at my new blog post for installing Exchange Server 2013 Preview prerequisites on Windows 2008 R2 SP1. I hope this new script is as useful as yours has been on my many Exchange 2010 installs. Thanks.


  10. Stuart
    August 16th, 2012 at 07:30 | #15

    I get the following errors when running #11:

    Creating CLSIDs…
    New-Item : The registry key at the specified path does not exist.
    At C:\Users\***\Desktop\exch_installprereq.ps1:150 char:10
    + New-Item <<<< -Path $CLSIDKey -Name $PDFGuid -Value $pdfFilterLocation –
    Type String
    + CategoryInfo : InvalidArgument: (HKEY_LOCAL_MACH…\MSSearch\CL
    SID:String) [New-Item], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Co

    Setting threading model…
    New-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\ExchangeServer\V1
    4\MSSearch\CLSID\{E8978DA6-047F-4E3D-9C78-CDBE46041603}' because it does not ex
    At C:\Users\***\Desktop\exch_installprereq.ps1:154 char:18
    + New-ItemProperty <<<< -Path "$CLSIDKey\$PDFGuid" -Name "ThreadingModel"
    -Value "Both" -Type String
    + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\…8-CDBE4604160
    3}:String) [New-ItemProperty], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewIt

    Setting Flags…
    New-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\ExchangeServer\V1
    4\MSSearch\CLSID\{E8978DA6-047F-4E3D-9C78-CDBE46041603}' because it does not ex
    At C:\Users\***\Desktop\exch_installprereq.ps1:158 char:18
    + New-ItemProperty <<<< -Path "$CLSIDKey\$PDFGuid" -Name "Flags" -Value "1
    " -Type Dword
    + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\…8-CDBE4604160
    3}:String) [New-ItemProperty], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewIt

    Creating Filter Entries…
    New-Item : The registry key at the specified path does not exist.
    At C:\Users\***\Desktop\exch_installprereq.ps1:164 char:10
    + New-Item <<<< -Path $FiltersKey -Name ".pdf" -Value $PDFGuid -Type Strin
    + CategoryInfo : InvalidArgument: (HKEY_LOCAL_MACH…SSearch\Filt
    ers:String) [New-Item], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Co

  11. Jeff
    December 12th, 2012 at 12:55 | #16

    Is there a reason why there is an option to disable IPv6 as a prereq? On our initial build of Exchange 2010 we disabled IPv6. Now Microsoft is stating that IPv6 should NOT be disabled on exchange 2010 servers.

    • Pat Richard
      December 12th, 2012 at 12:58 | #17

      Because when that script was developed, disabling IPv6 was still a best practice. Even now, disabling IPv6 doesn’t cause any issues.

  12. zabi
    December 20th, 2015 at 08:09 | #18

    yes but how to run the script please help

  1. September 26th, 2011 at 09:59 | #1
  2. December 23rd, 2011 at 11:15 | #2
  3. January 6th, 2012 at 15:56 | #3
  4. April 1st, 2012 at 03:58 | #4
  5. July 30th, 2012 at 15:17 | #5
  6. December 15th, 2012 at 11:26 | #6
  7. September 9th, 2015 at 17:07 | #7