Virtualization, Cloud, Infrastructure and all that stuff in-between

My ramblings on the stuff that holds it all together

Category Archives: Exchange 2007

ExPrep – Script to Automate Exchange 2007 Pre-Requisite Installation

 

If you have ever had to install Exchange 2007 on a Windows 2008 (and 2003) server you will know that there are a number of pre-requisites that need to be installed from the OS for each role; for example IIS web services and metabase compatibility components.

You have two choices, do this via the UI using the add/remove features and roles Wizard in Server Manager or using the ServerManagerCmd.EXE command line utility – either way it’s pretty tedious to do if you have several servers to install.

Based on this handy reference from Microsoft I have built a very basic batch file that automates the installation of the pre-req components for you.

It only works on Windows 2008 (sorry no 2003 equivalent) and you use it entirely at your own risk – there are much cleverer ways of scripting this but I’m a pretty old skool DOS person, this works for me and is easy for me to maintain – feel free to re-write in something more modern and post it back here this code is probably quite hacky.

The contents of the file are here (just cut & paste into a .bat file)

@echo off

REM ExPrep.bat by Simon Gallagher, ioko (http://vinf.net)
REM Usage Instructions and further information here
REM https://vinf.net/2009/05/13/exprep-script-to-automate-exchange-2007-pre-requisite-installation/

REM YOU USE THIS SCRIPT ENTIRELY AT YOUR OWN RISK
REM
REM Version 1.0

SET %EXPREP%=999
echo 1…….Mailbox Role (non-clustered)
echo 2…….Mailbox Role (Clustered)
echo 3…….Client Access Server (CAS)
echo 4…….Hub Transport (HT)
choice /C 1234
SET EXPREP=%ERRORLEVEL%
echo you chose %EXPREP%
pause

echo Preparing for base pre-req install

ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Digest-Auth
ServerManagerCmd -i Web-Windows-Auth
ServerManagerCmd -i Web-Dyn-Compression
ServerManagerCmd -i PowerShell

echo you chose %EXPREP%

if %EXPREP%==1 goto MBX
if %EXPREP%==2 goto MBX-CLUSTER
if %EXPREP%==3 goto CAS
if %EXPREP%==4 goto HT

goto end

:MBX
echo preparing for Mailbox Role (non-clustered)
pause
ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Windows-Auth

goto end

:MBX-CLUSTER
echo preparing for Mailbox Role (clustered)
pause
ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Windows-Auth

ServerManagerCmd -i Failover-Clustering

goto end

:CAS
echo preparing for CAS role
pause
ServerManagerCmd -i Web-Server
ServerManagerCmd -i Web-ISAPI-Ext
ServerManagerCmd -i Web-Metabase
ServerManagerCmd -i Web-Lgcy-Mgmt-Console
ServerManagerCmd -i Web-Basic-Auth
ServerManagerCmd -i Web-Digest-Auth
ServerManagerCmd -i Web-Windows-Auth
ServerManagerCmd -i Web-Dyn-Compression

ServerManagerCmd -i RPC-over-HTTP-proxy

goto end

:HT
echo preparing for HT role
pause
Echo nothing extra needed, PowerShell done already
goto end

:END
echo Done

Instructions:

1) Copy the script (ExPrep.bat) to your would-be Exchange server (remember Windows 2008 x64 is the only supported OS for Exchange 2007).

2) Run ExPrep.bat

3) Choose the appropriate role from the menu (note: there is no clever input validation – make sure you choose the correct one, there are pause statements before it actually does anything so you can CTRL-C to break out.

clip_image002

4) Sit back and wait for it to complete.

5) then run the Exchange 2007 installer from your DVD or network share as normal.

If you need to install multiple roles on a single server you can run the script multiple times, all changes are cumulative and if a component is already installed ServerManagerCmd.EXE (which the script calls) will just skip it.

If you wanted to take it further there is some excellent information about the setup process, failures and doing full unattended installations of Exchange 2007 here and here

Remember you use this entirely at your own risk, and you assume full responsibility for checking its suitability for your environment; the batch file is easy to read and customize for your own use, although I ask that if  you do make changes link back here via a comment or trackback so that other people can benefit.

Exchange 2007 Automated Install & Documentation Template Resources

 

The Exchange team Blog (EHLO) has a pointer to some good resources for building an automated Exchange 2007 installation here and here

it also has some templates for your server build documentation for Exchange servers, always better to start with something than start from scratch!

Automation is one of those great things in Microsoft products, almost all of the products support automated installation, but often unless you are setting up hundreds of them the time invested to get it up and working far exceeds the time it would take to deploy so any pre-build resources and guides are an excellent idea.

Install automation can ensure you have repeatable results – this is especially handy where you are factoring in a non-P2V disaster recovery situation or where you have labs/demo environments or are trusting local IT staff to deploy and manage enterprise applications in a distributed environment.

VMWare Workstation 6.5 Beta – Run Multiple Copies of Outlook/Exchange via Unity

 

I use a single laptop for my day-day use, it has all the stuff i need, I run Vista and Office 2007, for our corporate mail we use Exchange like everyone else and I use Outlook Cached Mode to work online/offline..

My own personal email is also an Exchange mailbox – provided by fasthosts (why – well, because..ok?) the problem with this is that I can’t have a single copy of Outlook connected to more than one Exchange server at the same time or run multiple instances of Outlook (I’ve tried all the hacks and Thinstall etc.), and to be honest even if I could it would probably violate the security policies of all the involved organisations as it would be quite simple for an Outlook-aware worm to try to propagate itself across multiple organisations or harvest confidential details.

The problem is further compounded by the fact that I often work on long-term customer projects and have to have a mailbox on their Exchange system as well… which leads to multiple diary sync nightmare, maybe I’ll blog about that some other time).

So at present I have 4 Exchange mailboxes that I need to keep track of, auto-forwarding mail between them is a no-no, I used to be an Exchange admin and I’ve lost many bank holidays due to corporate->Hotmail NDR mail loops!

So, up until now I’ve had to run one full Outlook client and multiple OWA clients in a browser, which is ok as long as I’m connected to the Internet, but no good if I’m on a train unless I want to close and restart Outlook with multiple profiles, which is a pain especially when you are collaborating on a project between multiple organisations. To be honest as good as OWA 2003 is it’s no substitute for a full outlook client. (still waiting for Fasthosts to go to Exchange 2007, oh and enable EAS!).

So, anyway a solution – VMWare Unity, this is a feature like Parallels for the Mac which lets you “float” an application window out of a guest VM to the host desktop meaning you can use the applications without working within a single VM’d desktop window.

VMWare Fusion also has the same feature, but Workstation 6.5 is the 1st time its been available on the PC platform.

To use Unity you need to have upgraded the virtual machine to 6.5 “hardware” by right clicking on the VM in the sidebar pane (below) and install the latest VM Tools – it also only seems to support XP at present, or at least it didn’t work on the Server 2003 VM I had.

image image

Boot the VM… and install the latest VM tools.

image image

VM Workstation Screen – note VM is set to “Unity mode”

imageimage 

My Vista desktop (yes, I have the start bar at the right hand side – widescreen laptop!) with the popup menu for the VM, showing all the start menu for applications installed within in it.

imageimage

 image

the following screen shot is Calculator running from inside the XP VM but in a single window on the Vista desktop – note the red border and the image icon, denoting that its presented via Unity.

image

It even shows up on the start bar with the correct icon; although this doesn’t seem to work until its been run a couple of times; I assume it needs to cache an icon or something.

image

it also seems to respect the window snapshots you get whilst Win-Tab between applications, even for pop-up windows

image 

Technically I can use this to run n x Windows XP/Outlook 2003 VM’s presenting Outlook through to my Vista desktop and comply with all organisations security policies, as each VM and its respective copy of Outlook runs in isolation from each other with the relevant company-specific AV client (or at worst, the same level as if I were using a machine connected to a public network in that they all share a vm network) – I don’t enable shared folders between the VMs.

It’s still a beta feature at the moment, and there seem to be a few bugs particularly when resizing windows sometimes it doesn’t work properly and double clicking to expand to full screen overlays the start-bar on my vista machine.

And it does seem to get confused sometimes and not allow keyboard input, so you have to flick back to non-unity mode and then back to continue, and sometimes a reboot of the guest VM but it is an early build so I would guess this will be resolved.

As an added bonus VM Workstation seems to allow the Vista host OS to go into sleep mode even whilst VMs are running, this is something I’ve not had much luck with in the past – it would generally refuse to sleep when I closed the lid (but thats not a scientific comparison… it may have just been bad luck!)

So, the pay-off – 2 copies of Outlook (2003 and 2007) seemingly running on the same desktop, alt-tab works ok and you have access to all the functionality of both without having to switch between or run multiple OWA sessions and from a security perspective it’s not really any different from having 2 physical PCs in front of you (slight memory overhead, but my laptop has 4Gb RAM, so not a huge issue).

Opening attachments is obviously going to be a bit of an issue, as you’ll technically need an individually licenced instance of Office 2003 in each VM as they can’t (yet) exchange data between them… and that would compromise the security principal.

image

Exchange 2007 SP1 Upgrade Process on a CCR cluster

 

I used this process to carry this out – worth bearing in mind that you do need some downtime to the clustered mailbox instance to carry this out – it took about 60 seconds to do that and installing the SP1 code on each passive node took approx 5 mins each + a reboot

image

Exchange 2007 CCR Configuration Notes

 

Once you’ve followed the installation process and have your active and passive nodes setup you may not actually be able to failover and mount the stores – it fails and logs an event 9317 from MSExchangeSA as below;

image

The fix is to register an SPN for each cluster node as per this KB article – why setup doesn’t do this for you I don’t know?

add-ADPermission -Identity “cn=exchange-cms,cn=computers,dc=mydomain,dc=com” -User “node-cl1$” -AccessRights WriteProperty -Properties “Validated-SPN”

You do this using the Exchange Management {Power}Shell Applet using the following command.

One thing to bear in mind – particularly if you are implementing a CCR cluster across mode than one physical site (single subnet required) you’ll need to wait for each node’s respective AD Domain Controller to replicate the changes.

Once that was completed I could fail over the cluster nodes perfectly.