PowerShell: Allowing all file exts. for ConfigMgr

When running Configuration Manager 2007 on Windows Server 2008, you must enable certain file extensions in IIS, so that a BITS-enabled distribution point (DP) can transfer files correctly. See this Technet article for more information.

If you would like to enable all of the file extensions on a BITS-enabled DP, simply run the following PowerShell code:

function EnableAllExtensions()
{
    $ahPath = "$((Get-WmiObject Win32_OperatingSystem).SystemDirectory)inetsrvconfigapplicationHost.config"
    if (-not [IO.File]::Exists($ahPath)) { return } # If file doesn't exist, return
    $xd = New-Object Xml.XmlDocument
    $xd.Load($ahPath)
    $nodes = $xd.SelectNodes("/configuration/system.webServer/security/requestFiltering/fileExtensions/add")
    foreach ($child in $nodes)
    {
        $child.SetAttribute("allowed", "true")
    }
    $xd.Save($ahPath)
}

. EnableAllExtensions


Hope this helps!

Don’t forget to make your WebDAV configuration edits using PowerShell also!