I thought this was confusing, so I figured if it helps one person it is worth posting!

In order to do a WMI query for items that are NOT of a certain definition (for example, machines models that do not begin with “M”), you may think that you would include “NOT LIKE” in your query. The truth is, your query should look like this:

SELECT * FROM Win32_ComputerSystemProduct WHERE NOT Version LIKE “%M%”


Automate New User Creation with SCSM 2012 SP1 and Orchestrator

If you want to automate new user creation with SCSM 2012 SP1 and Orchestrator 2012 SP1 (or R2, for that matter), follow this:

ZTI Error When Capturing Windows 8 for Deployment

So, I heard that you were trying to capture a base Windows 8 image for deployment. You are at least using MDT 2012 Update 1, correct? Good! What’s the problem, then? I see…on your reference machine, you are receiving an error message that contains “ZTI error: unhandled error returned by LTIApply: Not found (-2147217406 0x80041002)”.

Seriously, stop panicking. It is sort of unbecoming.

The issue is that the script is failing to check for the existence of the boot folder on the system partition before running a command called “takeown.exe,” which changes folder ownership. (NOTE: this does NOT occur if you are capturing a Windows 8 image that was originally deployed using MDT 2012 Update 1).

The fix, if you are so brave (just do it), is as follows:

  • Open %DeployRoot%\Scripts\LTIApply.wsf and C:\Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Scripts\LTIApply.wsf
  • Locate the “copy bootmgr” section in both
  • Add the following code above the copy bootmgr code:

If not oFSO.FolderExists(sBootDrive & “\Boot”) then

   oFSO.CreateFolder(sBootDrive & “\Boot”)

End if

SCCM Query for Laptops

Here is a quick query to gather all of the machines that report as laptops in your environment:

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId where
SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( “8”, “9”, “10”, “14” )

If you want to change the system enclosure type, here is Microsoft’s list of chassis type codes:

1 Other
2 Unknown
3 Desktop
4 Low Profile Desktop
5 Pizza Box
6 Mini Tower
7 Tower
8 Portable
9 Laptop
10 Notebook
11 Hand Held
12 Docking Station
13 All in One
14 Sub Notebook
15 Space-Saving
16 Lunch Box
17 Main System Chassis
18 Expansion Chassis
19 Sub Chassis
20 Bus Expansion Chassis
21 Peripheral Chassis
22 Storage Chassis
23 Rack Mount Chassis
24 Sealed-Case PC