IIS and BranchCache Setup & Config
This page will cover additional items to setup for IIS, along with adding BranchCache component required for the P2P functionality to work.
Windows Component setup, IIS & BranchCache. From elevated PowerShell:
Add-WindowsFeature Web-Server, Web-Http-Errors, Web-Static-Content, Web-Digest-Auth, Web-Windows-Auth, Web-Mgmt-Console, BranchCache IIS MIME Types
#Set the MIME types for the iPXE boot files, fonts etc.
function Set-IISMIMETypes {
# Set the MIME Types for the iPXE boot files, fonts, etc.
# v2.0 - accounts for duplicates (e.g. BIN, TTF, WIM)
$mimeTypeList = @(
@(".", "application/octet-stream"), # BCD file (with no extension)
@(".bcd", "application/octet-stream"), # boot.bcd boot configuration files
@(".bin", "application/octet-stream"), # wimboot.bin file
@(".com", "application/octet-stream"), # BIOS boot loaders
@(".efi", "application/octet-stream"), # EFI loader files
@(".img", "application/octet-stream"), # .img file type
@(".ipxe", "text/plain"), # .ipxe file
@(".iso", "application/octet-stream"), # .iso file type
@(".kpxe", "application/octet-stream"), # For the UNDIonly version of iPXE
@(".n12", "application/octet-stream"), # BIOS loaders without F12 key press
@(".pxe", "application/octet-stream"), # For the iPXE BIOS loader files
@(".sdi", "application/octet-stream"), # For the boot.sdi file
@(".ttf", "application/octet-stream"), # For the boot fonts
@(".wim", "application/octet-stream") # For the winpe images itself
)
foreach($mimeType in $mimeTypeList)
{
#$mimeType[0] - extension; $mimeType[1] - mimeType
if((Get-WebConfigurationProperty -Filter "system.webServer/staticContent" -Name "Collection").Where({$_.fileExtension -eq $mimeType[0]}).Count)
{
# Update the existing setting without destroying everything else :)
Set-WebConfigurationProperty -Filter "system.webServer/staticContent/mimeMap[@fileExtension='$($mimeType[0])']" -Name "mimeType" -Value $mimeType[1]
}
else
{
# Add a new setting
Add-WebConfigurationProperty //staticContent -name collection -value @{fileExtension=$mimeType[0];mimeType=$mimeType[1]}
}
}
}
#Run the Function
Set-IISMIMETypes

IIS Virtual Directory

Last updated

