Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, April 24, 2014 11:55 PM
I would like to know how to write a conditional step that runs ONLY if a bunch of other steps did not run. This has to do with applying driver packages. Basically, I want to run an action IF no "Apply Driver Package" step was run, because that means you don't have a supported hardware model.
So, if you don't meet the requirements to run any of our Apply Driver Package steps, I want to run a "catch all" step that will catch non-standard machines. Perhaps this screenshot will help explain.
Another way to ask this might be, is there anything that these Apply Driver Package steps do to the filesystem or the registry that I can key off of? Then if I don't find the indicator I can run my "catch-all" step?
All replies (2)
Friday, April 25, 2014 5:19 AM âś…Answered | 2 votes
Daniel's method works but adds a lot of additional tasks and general clutter to the TS IMO.
What I would do would be to add a task before any of your apply driver package tasks that returns a custom, non-zero error code; e.g., 999. This could be a simple one-line batch file containing exit /b 999. Set this task to always continue on error.
in task sequence variable _SMSTSLastActionRetCode equals 999 or not to conditionally determine whether the group/task should be executed or not. If any of the previous Apply Driver Package tasks was run and succeeds, then _SMSTSLastActionRetCode won't equal 999.
Can't say I've tested this, but it should work.
Jason | http://blog.configmgrftw.com
Friday, April 25, 2014 2:51 AM | 1 vote
We had done this before with some prior task sequences to ensure no unsupported models were deployed with OSD. It requires just another level of folders.
In your Dell and HP folders create folders for each step and move the WMI queries you are using to the folders, instead of the individual tasks. Add a step to set a task sequence variable at the bottom of each new folder called something like 'Applied Drivers' setting a task sequence variable to TRUE. Then set a condition on the UIUSD folder to only when Applied Drivers is FALSE. You may also need to set Applied Drivers to FALSE earlier in the task sequence before your Dell folder.
There may be an easier way, but this worked well for us.
Daniel Ratliff | http://www.PotentEngineer.com