Re: and in the real world...
IIS was a poor example to pick. You can script IIS changes. Here's a snippet of one of my deployment powershell scripts which I use to create or update instances of my SaaS product on the production server. Much less error prone and time consuming than using the IIS GUI admin tool; I modify the config files to tell it where things should be installed, and then run the scripts to do the installation.
function CreateIISSite($hostName,$iisName,$folderName)
{
$iisSiteName = $iisName
$iisAppPoolName = $iisName
$iisAppPoolServiceName = $iisName + "Service"
$iisAppPoolDotNetVersion = "v4.0"
$directoryPath = "D:\mycompany\$folderName"
#check if the app pool exists
if (!(Test-Path "IIS:\AppPools\$iisAppPoolName" -pathType container))
{
#create the app pool
$appPool = New-Item "IIS:\AppPools\$iisAppPoolName"
Set-ItemProperty "IIS:\AppPools\$iisAppPoolName" -Name "managedRuntimeVersion" -Value iisAppPoolDotNetVersion
$appPoolService = New-Item "IIS:\AppPools\$iisAppPoolServiceName"
Set-ItemProperty "IIS:\AppPools\$iisAppPoolServiceName" -Name "managedRuntimeVersion" -Value iisAppPoolDotNetVersion
}
#navigate to the sites root
#check if the site exists
if (!(Test-Path "IIS:\Sites\$iisSiteName" -pathType container))
{
#create the site
$iisSite = New-Item "IIS:\Sites\$iisSiteName" -bindings @{protocol="http";bindingInformation=":80:" + hostName} -physicalPath "$directoryPath\Root"
Set-ItemProperty "IIS:\Sites\$iisSiteName" -Name "applicationPool" -Value $iisAppPoolName
if ($hostName -ne "$iisSiteName.mycompany.com")
{
New-WebBinding -name "$iisSiteName" -HostHeader "$iisSiteName.mycompany.com"
}
True, right now I run the scripts by going in with RDP and clicking on a file, instead of a better way, but that's because I can get away with it.
So you can script IIS. Arguably, you *should* script IIS. If Microsoft want to insist that you **MUST** script IIS, then they're going to lose a lot of friends =)