Problem: I want my task sequence to do different things when its faced with a laptop over a desktop or a certain model, or even if different ammounts of memory are installed in the system. Is there anything I can do to get granular with this yet just have the one task sequence?
Solution: It’s pretty straight forward really with customised groups that have conditions on them.
Personally I have just a couple of task sequences that can implement different builds based on conditions and it really is easy to do!
First of all you’ll want to create a normal task sequence to install an operating system. Once the basic operating system task sequence is set up and you’re happy with it you can create new Groups and start customising as you see fit.
First step is to create a new group. Under ‘State Restore’ you should see you already have a folder created by default called ‘Custom Tasks’. Create a new group under there and give it a sensible name. I’ll run through a couple of examples here and then you should see how the sky is the limit really. To add a group select ‘New Group’ from the ‘Add’ menu.
I have created four groups here in my example below. Desktops, Laptops, HP Systems and Windows 7 systems.
So for Desktops and Laptops it’s really easy because I can use the simple MDT properties ‘IsLaptop’ and ‘IsDesktop’ which are set when the script ZTIGather runs. ZTIGather will examine the machine and set one of these to ‘True’ leaving the other(s) ‘False’. More information on default properties you could use can be found in the MDT help, you can also set your own should you wish to do so. So, I can put a condition on the group and ensure that if the condition is met, the task sequence runs what’s in the group otherwise it will skip over it and move on. Inside this group I could run custom scripts or install applications, whatever I desire. So highlighting my ‘Desktops’ group I can add a condition like this:
For the Laptops group I would simply repeat the above replacing IsDesktop with IsLaptop in the Variable field.
Now when the task sequence runs on a machine it will process the conditions on this folder and run the contents supposing the conditions are met, clever stuff right?
OK so for my HP Systems group I am going to use a WMI query. Following a similar procedure to above, I add a WMI query condition on the HP Systems group like so:
There are plenty of resources where you could find out more about WMI Queries so I won’t get into them too much. Just know that you can get very granular with these. Very granular indeed. You can also add more than one so as an example it could be any HP machine (1st WMI Query), that has more than 2GB memory (2nd WMI Query) and has a QUAD Core CPU (3rd WMI Query).
Finally, a simple one to identify Operating system. For this one you select the operating system option from the conditions menu and then simply select your option like so:
A little self-explanatory this one really.
So there you have it, three examples on how you can build a singular task sequence but have it do different things depending on what it is faced with building. This could be handy if you need different software going on different units such as HP tools only going on HP systems etc etc.
There are other conditions you can set that I haven’t mentioned in this blog post, I would love to hear about your experiences using them and any hints/tips you would like to share.
Personally I like having a singular Server build task sequence which runs through varying tasks depending on what I name the server. I set a WMI Query on mine so that if my server name has ‘DC’ in it for instance, the task sequence knows it’s a domain controller and therefore adds roles and software which I like on my domain controllers.