PowerShell: Update your ConfigMgr OSD Boot Images to WinPE 3.1

When you upgrade your boot images in Microsoft’s System Center Configuration Manager (SCCM / ConfigMgr) 2007 from WinPE 3.0 to WinPE 3.1, you must run the ExportDefaultBootImage() WMI method on the SMS_BootImagePackage WMI class for each boot image architecture. Typically this would simply include x86 (32-bit) and x64 (64-bit) boot images (Windows Image Format (WIM) files).

There are a few different methods of running this WMI method:

  • Manually through wbemtest
  • Using the VBscript scripting language
  • A PowerShell script

Since the first two methods have been covered already by other people, I will show an example of using Windows PowerShell to call the method. Simply replace the SCCMServer and SiteCode variables with the appropriate values, and WIM paths with your own, and run the script.

Clear-Host
$SccmServer = 'MySccmServer'
$SiteCode = '123'
$BootImageClass = [wmiclass]"\$SccmServerrootsmssite_$SiteCode`:SMS_BootImagePackage"

$WimFiles = @{
    'x86' = '\$SccmServerSMS_$SiteCodeOSDbooti386winpe.x86.3.1.wim' 
    'x64' = '\$SccmServerSMS_$SiteCodeOSDbootx64winpe.x64.3.1.wim'
}

$BootImageClass.ExportDefaultBootImage('x64' , 1, $WimFiles.x64)
$BootImageClass.ExportDefaultBootImage('x86' , 1, $WimFiles.x86)