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

There are several additional MIME types that need to be added to the default list that IIS creates for you to be able to iPXE boot devices for OSD processes. Below is a script to populate those on the IIS Server:

#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

To confirm in IIS Manager, open IIS, Click "Default Web Site" and Double Click on MIME Types to get the list. Confirm the ones above are added.

IIS Virtual Directory

A virtual directory in IIS to point at the Remote Install Folder is needed. This can be done manually in IIS Manager, or via PowerShell. This command will create the virtual directory based on the default installation path of iPXE Anywhere Web Service:

To do this manually via the IIS Manager:

  • Open IIS, Right Click on "Default Web Site" and choose "Add Virtual Directory..."

  • Alias: Remoteinstall

  • PhysicalPath = C:\ProgramData\2Pint Software\2PXE\Remoteinstall

Once you have added it, it will show up in the console, and if you drill down you'll see the extra subfolders, and if you check the Advanced Properties, you can confirm the path

Last updated