Add machines to different OU’s in SCCM task sequence

So if you are using Microsoft System Center Configuration Manager (SCCM) and want to add your machines into different OU’s depending on whether they are laptops or desktops there are many ways you can do it. Probably the easiest way is to use MDT integration and then add a task sequence step condition to use the IsLaptop or IsDesktop task sequence variable:

IsLaptop equals “True”
IsDesktop equals “True”

This may not be suitable for all though, you may not have MDT integrated or you may want to go further than just laptop or desktop. Another option would be to use the machine name  if the naming convention lends itself to this i.e. machines names L1234 or D1234. You would add a task sequence step condition again but this time for WMI query:

SELECT * FROM Win32_ComputerSystem WHERE Name LIKE “L%”

SELECT * FROM Win32_ComputerSystem WHERE Name LIKE “D%”

This is all fine if you have set the OSDComputerName task sequence variable at the beginning of the task sequence but this doesn’t work in all situations. In this case you can run a WMI query to detect the hardware type. This is a little different from the chassis type as you might know about as that can be sometimes difficult to use, especially with multiple manufacturers. My preferred method is as follows:

SELECT * FROM Win32_ComputerSystem WHERE PCSystemType = “1”

SELECT * FROM Win32_ComputerSystem WHERE PCSystemType = “2”

1 is for desktops and 2 is for laptops. If you want to combine types then you can add an If statement to your task sequence step options and then specify multiple WMI queries.

If you want to go further and have many kinds of machine then the full table of system types are here:

Value Meaning
0 (0x0)
Unspecified
1 (0x1)
Desktop
2 (0x2)
Mobile
3 (0x3)
Workstation
4 (0x4)
Enterprise Server
5 (0x5)
Small Office and Home Office (SOHO) Server
6 (0x6)
Appliance PC
7 (0x7)
Performance Server
8 (0x8)
Maximum

2 thoughts on “Add machines to different OU’s in SCCM task sequence

  1. On an SCCM sequence, at which Task Sequence stage would you put any of these these on. I have tried “Apply Network Settings” on the options tab. However it’s not even joining the domain. Could you please advise further?

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.