Added an entry to create managed path for host headers

Jun 13, 2013 at 11:30 PM
Edited Jun 13, 2013 at 11:34 PM
Just in case anyone else is interested. To accomplish creating managed paths for host headers as in http://technet.microsoft.com/en-us/library/cc424952.aspx#section2d I made these changes to my script.

Still testing to see how it goes.

On AutoSPInstallerInput.xml
<ManagedPaths>
                <ManagedPath relativeUrl="help" explicit="true" hostheader="true"/>
        <ManagedPath relativeUrl="personal" explicit="false" hostheader="true"/>
</ManagedPaths>
On AutoSPInstallerFunctions.ps1, I replaced the managed path section on version 3.87 (line 2352)
Else
            {
                If ($managedPath.Explicit -eq "true" -and $managedPath.Hostheader -eq "true")
                {
                    Write-Host -ForegroundColor White " - Setting up explicit managed path `"$($managedPath.RelativeUrl)`" at `"$url`""
                    New-SPManagedPath -RelativeUrl $managedPath.RelativeUrl -Hostheader -Explicit -ErrorAction SilentlyContinue | Out-Null
                }
                ElseIf ($managedPath.Explicit -eq "true")
                {
                    Write-Host -ForegroundColor White " - Setting up explicit managed path `"$($managedPath.RelativeUrl)`" at `"$url`""
                    New-SPManagedPath -RelativeUrl $managedPath.RelativeUrl -WebApplication $url -Explicit -ErrorAction SilentlyContinue | Out-Null
                }
                Else
                {
                    Write-Host -ForegroundColor White " - Setting up managed path `"$($managedPath.RelativeUrl)`" at `"$url`""
                    New-SPManagedPath -RelativeUrl $managedPath.RelativeUrl -WebApplication $url -ErrorAction SilentlyContinue | Out-Null
                }
            }