Adding Conditions to Software In Task Sequence?? Need some help.
I have a task sequence which builds new vista machines and installs some software. However, my manager doesn't want to maintain two task sequences, he wants to have one and the software that is for just laptops we would add in a condition so that it only installs for the laptop. We currently build PCs through network boot and access an HTA page, on that page we select Desktop or Laptop and enter a service tag number (which ends up being the computer name). I have never worked with adding a condition in, I can see it working if we add a condition that looks up the computer name and if its D* or L* then install or don't install the software. I have no idea where to start, lol....hope someone can shed some light on this. And if I do have a statement that calls computer name or looks up the service tag, does this have to be declared somewhere. Thanks in advance.
November 10th, 2010 5:30pm

HTA page, on that page we select Desktop or Laptop and enter a service tag number (which ends up being the computer name). There are tons of ways to solve that problem, but I would extend the .hta so that is creates a TS variable. Let's call it 'computertype' and set it either to 'laptop' or 'desktop'. Then add a condition that checks for the value of 'computertype'. Done. http://technet.microsoft.com/en-us/library/bb693661.aspx
Free Windows Admin Tool Kit Click here and download it now
November 10th, 2010 5:57pm

Right now on the .hta page, there is a drop down to choose "laptop" or "desktop", so I should be able to call that. I did notice some logic in the task sequence after, it was: Namespace: root\cimv2 Query: Select * from Win32_ComputerSystem WHERE PCSystemType= 2 But I don't think this is functionally properly. I just started this job, and the guy I replaced didn't document anything, lol, fun times trying to figure it all out.
November 10th, 2010 7:19pm

We do a similar thing on our setup. Where we need to filter a piece of software for a particular model we use a WMI query such as: Select * From Win32_ComputerSystem WHERE Model LIKE "%HP EliteBook 27%" OR Model LIKE "%TECRA M%" OR Model LIKE "%7763W%" OR Model LIKE "%7453WFQ%" OR Model LIKE "%7450%" That above query is what's used to dictate which image gets pushed to our Tablet PC devices. Or another example, we have a group later on in the Task Sequence that installs the bluetooth and fingerprint software for a Tecra A11. Again this is machine specific so we only specify one device in the query: Select * From Win32_ComputerSystem WHERE Model LIKE "%TECRA A11%" Some queries can be huge if you have a lot of different models, I'd suggest creating a report in SCCM that lists the different models in your estate to help. There is another way, and that's be using the chassis type (3 = Desktop, 9 = Laptop) but manufacturers have a wonderful sense of what chassis is what. I've blogged it here http://systemscentre.blogspot.com/2010/07/chassis-type-vs-model-name.html in the past if you want a breakdown of the different chassis in your estate. If you wanted to move away from the HTA then we also use a very simple VB Script at the begining of the task sequence to prompt for the computer name, and like you use a standard of PC<AssetTag> or LT<AssetTag> Dim sNewComputerName, oTaskSequence, sTSMachineName Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment") ' Get the name the computer is set to receive and truncate to first 6 letters sTSMachineName = oTAskSequence("_SMSTSMachineName") sTSMachineName = lcase(left(sTSMachineName,6)) If sTSMachineName = "minint" Then ' The wscript.echo commands are logged in SMSTS.log for troubleshooting. ' They are not displayed to the end user. wscript.echo "Detected that the computer name is scheduled to receive a random value. Prompting user to input a standard name." sNewComputerName = InputBox ("Please enter a standard computer name.", "Computer Name", , 30,30) oTaskSequence("OSDComputerName") = sNewComputerName wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName Else wscript.echo "Computer set to receive a standard name, continuing as is." End If It's not my code, but I can't remember now where I dug it from on the internet. This has enabled us to move to one task sequence that is used for all our desktops, laptops and tablets using only 2 Wim files (1 for desktops/laptops and 1 for tablets due to SP3 not intergrating) with bare minimum in the WIMs and all model specific customisations done in the TS and without the need for an HTA pre-flight screen. Cheers, SBMy System Center Blog
Free Windows Admin Tool Kit Click here and download it now
November 10th, 2010 11:52pm

Hi codefinder, As this thread has been quiet for a while, we assume that the issue has been resolved. At this time, we will mark it as "Answered" as the previous steps should be helpful for many similar scenarios. In addition, we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems. Thanks,Yog Li -- Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
November 23rd, 2010 4:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics