WMI queries to find 64 and 32 bit computers:
SELECT * FROM Win32_OperatingSystem WHERE OSArchitecture = "64-bit"
SELECT * FROM Win32_OperatingSystem WHERE OSArchitecture = "32-bit"
Discussions about system management technologies. Including, but not limited to, ConfigMgr, WDS, MDT, WSUS, Forefront, VMM, Hyper-V etc.
WMI queries to find 64 and 32 bit computers:
SELECT * FROM Win32_OperatingSystem WHERE OSArchitecture = "64-bit"
SELECT * FROM Win32_OperatingSystem WHERE OSArchitecture = "32-bit"
Using ConfigMgr 2012 RC2 OSD I got the bellow error (Message ID 11135):
The task sequence execution engine failed executing the action (Apply Operating System) in the group (Build the Reference Machine) with the error code 2147942402
Action output: , dwFlags, hUserToken, pszUserName, pszUserPassword), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\resolvesource.cpp,3217)
ResolveSource(pszSource, sSourceDirectory, dwFlags, 0, 0, 0), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\resolvesource.cpp,3122)
TS::Utility::ResolveSource( this->packageID, this->packagePath, TS::Utility::ResolveSourceFlags::PersistContents ), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\applyos\installscripted.cpp,160)
installer.install(), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\applyos\installscripted.cpp,632)
Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\TST0000B
The user tries to release a source directory C:\_SMSTaskSequence\Packages\TST0000B that is either already released or we have not connected to it
InstallScripted( g_InstallPackageID, g_ImageIndex, targetVolume, g_ConfigPackageID, g_ConfigFileName ), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\applyos\applyos.cpp,493). The operating system reported error 2147942402: The system cannot find the file specified.
The problem was that for the Network Access Account I left “Use the computer account of the Configuration Manager client” in the Software Distribution Component properties. As soon as I have replaced it with a standard user account, the Task Sequence finished successfully.
Depending on what you need the .wim file for, you can create it manually or automatically.
- To manually create a .wim file (capture image) you need a bootable CD with Windows PE (with ImageX.exe included) that you can create using Windows Automated Installation Kit.
The basics steps are:
Where: C: is the partition to be captured; D:\CapturedImage.wim is the place of the captured file; “My captured image” is the name of the file.
More switches can be found on the ImageX Command-Line Options page.
If you need the image for deployment, do not forget to run sysprep before capturing the image!
- To automatically create a .wim file you can use a capture media created using Configuration Manager.
If you want to capture a Windows XP OS, copy sysprep files to C:\sysprep. Newer operating systems have sysprep files installed by default.
To use capture media:
Besides using Software Distribution to install software, you can do this using a Task Sequence too. This can be done during and Operating System Deployment process or not.
Usually, I install software during an OSD. For this, you must have a package for that software product (of course) and at least one program that runs silently. If the program requires user intervention, you will not have the possibility to add it to your TS. I hope you know the fact that the package should exist on a Distribution Point.
This is how one of my simplest TSs looks like:
To add an Install Software step, in your TS click Add from the menu and select General – Install Software.
Then, type a name for this step and using the Browse button select a package to add the TS. Remember that you can only add packages that has a program to run without user intervention.
I find it useful to have a step to install latest updates after all install software steps.
One more way to install software using a TS, is to have only Install Software steps. This way, you can install multiple software products using one advertisement instead of advertising every package. I use this only when I have an OS installed and I want to install software on it.
Following the post regarding how to install drivers based on computer model using WMI query, here is another query you can use in your task sequences to install some processor specific software for example.
To find the processor manufacturer during a task sequence, insert a condition for the step you need, and select Query WMI. Then, for WMI Namespace use root\cimv2. For WQL Query use SELECT * FROM Win32_Processor WHERE Manufacturer like “%GenuineIntel%” or SELECT * FROM Win32_Processor WHERE Manufacturer like “%AuthenticAMD%” depending on what you need.
To find the processor manufacturer of your computer, open a command prompt and type the following: WMIC CPU GET Manufacturer.
Our helpdesk asked me to make a task sequence that can be used on computers with more than one partition. In this case, I had to make sure that the operating system will install only on first partition and will not touch the data on other partitions.
To achieve this, I copied another TS and modified the following 2 steps:
This way, when TS runs, it automatically wipes partition 1 from disk 0 and will not touch any other partition or disk.

When using task sequence, you might want to install different driver packages for different computer models. This can be accomplished by using a WMI query.
First of all you need to have driver packages for all your computer models and know the exact model name for every computer.
To find this, open a command prompt and type WMIC ComputerSystem GET Model (use this command on every computer to find it’s model).
Then, Edit your task sequence. Add how many steps you need with “Apply Driver Package”. Select the driver package you have created for a certain computer model (HP dc5700 in my case).

In the Options tab, click Add Condition and select Query WMI. In the WMI Query Properties window, make you sure you have root\cimv2 as WMI Namespace and write the following query in the WMI Query input box:
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE “%dc5700%” for HP Compaq dc5700 computer models.
![]()
Now, for every driver package, replace the model name with the computer model name the driver package is for. This way, the task sequence will install the correct drivers on every computer that will match the model specified in the query and will skip other steps sending the following status message: “The task sequence execution engine skipped the action (HP Compaq dc5700) in the group (Apply driver packages) because the condition was evaluated to be false”.
Having to create a package with McAfee ePO agent, I wanted to make it available to task sequence too so it can be installed during the operating system setup. For this, I had to make it install unattended or silent not requiring any user input. As I have never worked with McAfee, first, I did not understand what the purpose of this agent is. I couldn’t understand why you should install the agent and not the antivirus software itself? When I did, I started to think how to deploy it easily and with no user interaction.
So, to do this, simply put FramePkg.exe into a folder, say “ePO”, and create a package as you normally would. Then create a program that has the following command line FramePkg.exe /install = agent /silent.
If you want to install ePO as part of one task sequence, make sure the program can run whether or not a user is logged on and do not allow users to interact with the program.
This way, after the computer is added to domain it will connect to the server and will receive all necessary settings (for example install antivirus software, patches and latest definition updates).
Short post that I think might be useful…
If you receive the following error: “An error occurred while retrieving policy for this computer (0x80072EE7)” when Task Sequence Wizard starts, this can happen if you have DHCP or DNS problems.
You should check if you can contact the DHCP server in order to get an IP address or you can configure a static IP address.

If you have a switch with STP enabled, you might want to read this post.
After the task sequence to deploy the reference computer (Home-XPSP3-Ref01) finishes, a captured image of the reference computer is stored in \\Home-SCCM\Captures$\Home-XPSP3-Ref01.wim. Now, We’ll create a task sequence that will deploy the captured image of reference computer to the target computer (Home-XPSP3-Tar01).
To create a task sequence to deploy the captured image to the target computer:
| On this wizard page | Select Client Task Sequence, and then click Next. |
| General | In Task sequence name, type Windows XP SP3 Target Deployment. In Task sequence comments, type Task sequence for deploying captured reference computer image to the target computer (Home-XPSP3-Tar01), and then click Next. |
| Details | Click Join a domain. In Workgroup, type Home.local. In User name, type Work User. In Organization name, type Work Organization. In Product key, type product_key (where product_key is the product key for Windows XP SP3). In Capture destination, type \\Home-SCCM\Captures$\Home-XPSP3-Ref01.wim. In Capture Account, click Set, and then complete the Windows User Account dialog box by performing the following steps:
Click Next. |
| Boot Image | In Specify an existing boot image package, click Browse. In Select a package dialog box, click Windows PE Custom, and then click OK. Click Next. |
| MDT Package | In Specify an existing Microsoft Deployment Toolkit Files package, click Browse. In the Select a Package dialog box, click MDT 2008 Files, and then click OK. Click Next. |
| MDT Package: MDT Details | In Name, type MDT 2008 Files. In Version, type 1.00. In Comments, type Provides access to MDT 2008 software during Configuration Manager deployment process, and then click Next. |
| OS Image | Click Create a new OS image. In OS image file (WIM) location, type \\Home-SCCM\Captures$\Home-XPSP3-Ref01.wim. In Package source folder to be created, type \\Home-SCCM\Packages$\Home-XPSP3-Ref01_Image. Click Next. |
| OS Image: Image Details | In Name, type Windows XP SP3 Reference Image. In Version, type 1.00. In Comments, type Windows XP SP3 captured image of reference computer (Home-XPSP3-Ref01) used to deploy to target computers, and then click Next. |
| Client Package | In Specify an existing ConfigMgr client package, click Browse. In the Select a Package dialog box, click Configuration Manager Client Upgrade, and then click OK. Click Next. |
| USMT Package | In Specify an existing USMT package, click Browse. In the Select a Package dialog box, click USMT, and then click OK. Click Next. |
| Settings Package | Click Create a new settings package. In Package source folder to be created, type \\Home-SCCM\Packages$\CustomSettings_Target, and then click Next. |
| Settings Package: Settings Details | In Name, type MDT 2008 Target Computer Custom Settings. In Version, type 1.00. In Comments, type Configuration settings for MDT 2008 deployment process (such as CustomSettings.ini) for the target computer, and then click Next. |
| Sysprep Package | In Specify an existing Sysprep package, click Browse. In the Select a Package dialog box, click Configuration Windows XP SP3 Sysprep, and then click OK. Click Next. |
| Summary | Displays a status bar that shows the progress of the tasks defined in the wizard. The Import Microsoft Deployment Task Sequence Wizard closes when the task sequence is imported. |
By default, the task sequence sets the password for the local Administrator account to a random value. At this step we will specify the password we want.
To customize the Windows Vista Target Deployment task sequence:
Running the Import Microsoft Deployment Task Sequence Wizard to create the task sequence for the target computers, creates a new software distribution package and a new image.
To select the distribution points for software distribution package:
| On this wizard page | Do this |
| Welcome | Click Next. |
| Select Destination Distribution Point | Click Next. |
| Package | In Distribution points, select HOME-SCCM, and then click Next. |
| Completion | Click Next. |
| Wizard Completed | Click Close. |
To select the distribution points for operating system images:
| On this wizard page | Do this |
| Welcome | Click Next. |
| Select Destination Distribution Point | Click Next. |
| Package | In Distribution points, select HOME-SCCM, and then click Next. |
| Completion | Click Next. |
| Wizard Completed | Click Close. |
To create an advertisement for the task sequence:
| On this wizard page | Do this |
| General | In Comment, type Advertisement to deploy Windows XP SP3 reference image. In Collection, click Browse. In the Browse Collection dialog box, click All Unknown Computers, and then click OK. Select the Make this task sequence available to boot media and PXE check box. Click Next. |
| Schedule | Click Next. |
| Distribution Point | Click Next. |
| Interaction | Click Next. |
| Security | Click Next. |
| Summary | Click Next. |
| Confirmation | Click Close. |
Now, we can boot Home-XPSP3-Tar01 computer from the ConfigMgr2007_TS_Boot_Media.iso file created earlier.
On the Welcome to the Task Sequence Wizard page, in the Password field type P@ssw0rd and press Next. You will see that there are two assignments: Windows XP SP3 Reference Deployment and Windows XP SP3 Target Deployment. Select Windows XP SP3 Target Deployment and click Next to start the operating system deployment.

The operating system deployment starts. If any problems occur during the deployment, consult the MDT 2008 document or learn how to troubleshoot task sequence issues in Configuration Manager.
And that was the simplest way (and with any configuration made to the operating system) to make an image of a reference computer and then use that image to deploy target computers.