Enable F8 Command Line Support for legacy Boot Images in ConfigMgr 2012 R2

In the event that you need to import a WinPE 4.0 or 3.1 boot image into ConfigMgr 2012 R2, you may want to enable the F8 command line support once you have imported the boot image. Since the servicing capabilities for such boot images are disabled, we need to go outside the ConfigMgr console to make this kind of change.


This is what it looks like when you have imported a legacy boot image (WinPE 4.0 or WinPE 3.1) into ConfigMgr 2012 R2:
In my lab environment I’ve imported a clean WinPE 4.0 wim file and named it WinPE 4.0 (x86) as you can see in the picture above. In order to enable the F8 command line support for this boot image, we could either use wbemtest or PowerShell. I’m not a fan of the wbemtest utility for various reasons, and I prefer using PowerShell when possible. Before we go ahead and execute the PowerShell script, we need to know what we’re going to do. In the SMS Provider, there’s a class called SMS_BootImagePackages. For each boot image in your environment, there’s an instance with a set of properties. The property that we’re interested in is called EnableLabShell. If you examine this property, you’ll notice that it’s a lazy property (see this great article by Trevor Sullivan, PowerShell MVP). In the picture below, I’m using WMI Explorer to examine the instance of my boot image:
As shown in the picture, my boot image has a PackageID of CAS00020. This can be found in the ConfigMgr console by navigating to Software Library, Operating Systems and Boot Images. See picture below:
Since the EnableLabShell property has a value of False, we need to change it to True by using PowerShell. In the script that we’ll be using, we need to reference the instance of the boot image object directly. If we don’t do that, things will go bad.

Download the script

I’ve made the script available on the TechNet Gallery, and it’s available for download here.

Using the script

The script has two ways it can be executed in. The first one is where it will only query for the Boot Images. To actually make any changes to the instances, you’ll need to specify the -Commit switch.

Querying for Boot Images

1. Download the script to C:\Scripts.
2. Open an elevated PowerShell console and run the following command:

.\Set-CMBootImageEnableCommandLineSupport.ps1 -SiteServer CAS01 -SiteCode CAS -BootImageName "Win"

Note! Remember to change the SiteServer, SiteCode and BootImageName parameters for your own environment.

Committing changes to Boot Images

1. Download the script to C:\Scripts.
2. Open an elevated PowerShell console and run the following command:

.\Set-CMBootImageEnableCommandLineSupport.ps1 -SiteServer CAS01 -SiteCode CAS -BootImageName "Win" -Commit

Note! Remember to change the SiteServer, SiteCode and BootImageName parameters for your own environment.
When you have executed the script and committed, remember to run the Update Distribution Points for the specified Boot Image(s).
You should now be able to press F8 in your legacy WinPE boot images!


Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.


  • I have applied the changes and and set EnableLabShell= true. Verified it in WMI Explorer and the value is set to True. Redistributed the boot image and created task sequence media, but still F8 is not enabled. The boot image version that I am currently using is 10.0.10240.

  • I get the following error, when running the script from the scripts folder as a Domain Admin
    “Get-WmiObject : Invalid namespace “root\SMS\site_MB1”
    At D:\Scripts\Set-CMBootImageEnableCommandLineSupport.ps1:13 char:19
    + $BootImages = Get-WmiObject -Namespace “root\SMS\site_$($SiteCode)” -Class S …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand”

    • Hi Damo,
      Are you running the script on your Primary Site server? Have you installed the SMS Provider remotely to your Primary Site server?

  • I guess this is run on the server.
    if line 13 held the variable for machine name you could execute from a remote system.
    $BootImages = Get-WmiObject -ComputerName $SiteServer -Namespace “root\SMS\site_$($SiteCode)” -Class SMS_BootImagePackage -Filter “Name like ‘%$($BootImageName)%'”

  • hi nickolaj, just letting you know I was getting an error when trying to commit
    exception calling “put” with “0” argument(s): “generic failure “.
    But I was running it on a different primary server, went over to my cas and it ran fine.

  • Yes, I have a PE 3.1 image imported in to SP1 w/CU2. I tried your script but the WMI field appears to be locked. Changing false to true doesn’t stick.

    • Hi Steve,
      WinPE 4.0 images are the ones that you get with Windows ADK 8.0 and that’s a prerequisite for ConfigMgr SP1, so this should not be needed since you should be able to service such boot images. Are we talking about WinPE 3.1?



Do you want to be notified of new posts on our site?

Please enter your email address below:

Categories use cookies to ensure that we give you the best experience on our website.