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.
Installation
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.
Donations
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.
Download
v3.3 Set-Exchange2010Features.v3.3.zip
v3.2 Set-Exchange2010Features.v3.2.zip
v1.0 Set-Exchange2010Prereqs.zip
Changelog
See the changelog for information on features added in each version
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
Completed
Elapsed Time: 00:00:01
Organization Prerequisites
Completed
Warning:
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
Completed
Elapsed Time: 00:00:03
Hub Transport Role Prerequisites
Failed
Error:
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=14.1.218.11&e=ms.exch.err.Ex28883C&l=0&cl=cp
Warning:
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
Pending
————————————————–
Any help would be HUGH. I am stumped.
Thanks
I’m assuming that you’ve verified those services are running? And you’re running the installer as an admin?
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.
It’s on the list!
Great job dude!! Saved me a bunch of time. Best script I’ve seen like it
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.
Thanks for pointing this out. I’ve released a new version that resolves this.
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!
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.
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.
Which option is best is an organizational choice. But option 11 is the option I use the most.
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.
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
unzipped!
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
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.
http://justaucguy.wordpress.com/2012/08/15/exchange-server-2013-preview-prerequisites-script-2008-r2-sp1/
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
mmands.NewItemCommand
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
ist.
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
emPropertyCommand
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
ist.
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
emPropertyCommand
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
g
+ CategoryInfo : InvalidArgument: (HKEY_LOCAL_MACH…SSearch\Filt
ers:String) [New-Item], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Co
mmands.NewItemCommand
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.
Because when that script was developed, disabling IPv6 was still a best practice. Even now, disabling IPv6 doesn’t cause any issues.
@Pete
yes but how to run the script please help