At some stage you will want to install IIS6 on a server that doesn’t already have it. Let’s assume for a minute that you’re the administrator of a network with servers that require a fairly standard installation of IIS6 – why not create a script that does it all with one click? Read on …
I’m going to assume you’ve already got the .NET Framework 2.0 already installed. If you haven’t please read my article about how to perform an unattended installation of the Microsoft .NET Framework 2.0.
To perform an unattended installation of IIS6 you need 2 things. First you need to create an answer file for the installation program (Sysocmgr.exe) to get the IIS configuration from. Here is a link to a Microsoft document entitled "Creating an Answer File (IIS6)" but I’d recommend reading on anyway.
Why am I writing my own document about this? Simple – there are spelling mistakes and technically incorrect bits of info all over the Microsoft site (doesn’t Microsoft check their own technical documentation?) – unfortunately the Microsoft document linked above is one of the ones containing a typo. Their document lists one of the options as follows.
That is WRONG. The correct wording is:
Anyway, here’s a sample answer file for an IIS6 installation.
[InternetServer]
PathWWWRoot = C:\Inetpub\Wwwroot
It’s an answer file for a basic installation containing the WWW Service, ASP.NET, the IIS common files & COM+ Network (both those are required for the WWW Service) and a couple of other useful things like the administration tools. It does not include NNTP or SMTP but it’s easy to see how to enable those. The installation location is the default of C:\Inetpub\Wwwroot.
Once you’ve got the answer file sorted, how do you use it? Easy. If you save your answer file as C:\Scripts\iis6.inf you run a command like this one (obviously you’ll need to change the path and file names if you name and save it somewhere/something else).
C:\Windows\System32\Sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:C:\Scripts\iis6.inf |
The above command will run a completely unattended (but not silent!) installation of IIS6.
Please note that unless you’ve got the Windows installation files as well as the installation files for any service packs available for Sysocmgr.exe to find you may be prompted for their location during the installation.
And here is a sample script to do the whole lot, as I said, with one click. The script below will also un-register and re-register the .NET Framework with IIS – you may need to do this depending on what order you install IIS/.NET Framework.
@echo off :: Perform an unattended install of IIS6 :: :: Chris Rasmussen :: June 2008 :: :: Changes: :: :: June 11 2008 - Created script :: Install IIS6 :: Components: :: - ASP.NET :: - Com+ Network (required for WWW Service) :: - IIS Common Files (required for WWW Service) :: - IIS Manager :: - WWW Service :: - Application Server Console cls echo Installing IIS6 ... echo. C:\Windows\System32\Sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:C:\Scripts\iis6.inf echo Configuring ASP.NET and IIS ... echo. C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -u C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i |