To capture or not to capture?
One of the great religious battles of our day (as far as desktop imaging goes) is whether or not capturing a reference image and sysprepping, or deploying a standard "thin" image and installing the necessary applications through another means is the best way to go.
The majority of people capture thick images with preconfigured profiles and software.
I'm firmly in the thin image camp. Not having to deal with sysprep, reams, capturing, and maintaining multiple reference images is a major win for me. Also, not having to update the image every time a single piece of software in it needs a version bump is certainly a good thing. In my experience, admins responsible for client OS deployment tend to be on the more entry-level side of the curve (certainly not always, though). These admins generally have weaker scripting skills, but let me assure you - learning to script your installations might be more burdensome early on, but it will save you a lot of hassle later.
To properly roll your own thin images without something like SCCM, you will need to be familiar with
dismand scripting. If you're not familiar with either, you're about to get a crash course.
Let's break it down bit by bit.
First of all, there was a legacy requirement that crushed my soul that each lab computer have a static IP address whose last octet matched the PC number. So, if there was a computer in building A, room 101, and it was the 20th PC, the name would be A101-PC20 and it's IP might look something like 10.1.50.20. That's what the Set-IP function that I borrowed from poshcode.org does. It takes the network segment, the gateway, and the subnet mask, and sets the appropriate static IP. The switch statement later on sets the
$pcNumbervariable that is used in the last octet of the address.
Since all of these computers are staged in WDS using the netbootGUID, the computer is already named at the time this script is called from the unattend.xml file. All computers in a lab have a hyphen in them. All computers that are in standalone classrooms do not. This makes it easy to use a line like
$isInLab = $name.Contains("-")because it will return
$trueif the machine has a hyphen in the name, which makes it a lab computer. If it's a lab computer, we're going to split the name into an array called
$nameSplitwhich has the first element set to the lab name and the second element set to something like PC20. From there, we can split the 20 out of the name and use that in the last octet of the IP address. We'll use the name of the lab in a second.
The final block of code basically says that if a machine is in a lab, call the function to set the static IP address and then call a batch file on a server that has the scripted installations for all software in that lab. So, the batch file is named the same as the first part of the computer name that we split out earlier. This means that we can use the same unattended file and the same thin image, but have different sets of installed software per lab. If it's in a classroom, then it will get a default set of classroom applications that are on all classroom podium computers.
Sure, MDT can do all of this, but it seemed like a sledgehammer for a nail in my case. Sure SCCM can do this (and it can do it better), but there was no money for it. I got by with vanilla WDS, PowerShell, and batch scripting and it worked just fine for years. As far as I know, this is still the process being used to image the labs there, even though I'm long since gone.
Remember, don't be afraid to make your own tools!