WaaS–Post 1–PreCache Compat Scan TS

So this will be the first of several posts, well, it’s sorta the second, this heavily relies on the Script I posted for writing values to registry & WMI a few posts ago, however I’ve made several modifications to it since then, and have done A LOT of testing. Hence my last post about testing Low Disk Space machines.

WaaS Process, as Designed by Mike Terrill & Keith Garner quick overview:

  1. PreAssessment:  Set of Rules run against hardware inventory data to rule out machines that be known to fail the upgrade. Rules include:
    1. Hardware Checks
      1. Models
      2. Free Disk Space
      3. Memory
    2. Software Checks (Software we know that needs to be at specific versions to survive IPU, or not block it)
      1. 3rd Party Encryption Version level
      2. 3rd Party AV Version level
      3. Several other Apps
    3. General Checks
      1. Last HWInv Date
      2. Last MP Checkin
      3. OS / Build / OS Arch
      4. CCM Cache Size
  2. PreCache / Compat Scan (Task Sequence): After it passes all of the rules, the computer then added to a collection targeted with this TS.  The TS is setup as a Required Deployment, and set to Pre-Download Content, and Download all Content before starting the TS.  Then will dynamically download the driver packages, run the Check Readiness, and then Compat Scan.
  3. Schedule for Upgrade: After it has been cached, and passes the compat scan, the machines can be schedule (added to collection targed with the upgrade).

That’s a really quick overview of how we’ve setup WaaS, we went over this in great detail @ MMS, and I’d expect Mike Terrill to eventually blog that detail, I just don’t want to steal all of this thunder, but felt you needed a little overview to explain where this TS fits in.

This post will be covering PreCaching your Upgrade Media and Drivers, along with running the Compatibility Scan.

Here is what the TS looks like:
image

So Lets break this down:

  • Set SMSTSPersistContent & Set SMSTSPreserveContent (note the misspelling in the TS image, my bad) – Set both to true so that when you download the packages for the TS, it saves it to the CCMCache so it doesn’t remove after the TS Completes.
    image
    image
  • Set OSD Info Type & Set OS Build Version.  Variables used in scripts and steps later on.
    image
    image
  • Set WaaS_Stage (Sets registry Key, Eventually I want to go back and make this write to WMI as well, just haven’t had time)
    image
  • Set TS Var – Sets SMSTS_StartTSTime to the current time, to be used to calculate how long the TS ran.
    image
  • Power Settings Change – Details HERE
    • Set TS Var “PowerPlan” to Active Power Plan – This is grabbing the current power plan running and places that info into a variable
    • Set Power Options – High Performance – Sets the machine to High Performance power plan, to hopefully speed up the process
  • Set Driver and Content Download (Group)
    • Set Dynamic Variables (Model & Package)  This is a simple way to map Models to Packages of Drivers.
      image
    • Download Drivers and Content (Group)
      • Set Download Start Time
        image
      • Set SMSTSDownloadProgram to Null
        image
      • Set Driver Download Variables
        image
      • Download Driver Package
        image
      • Reset Download Variables
        image
      • Set Download Finish Time
        image
  • Storage Cleanup (Group) Runs if Free Space < 20GB Free – Not going to go into in this post
  • Check Readiness (RAM & Free Space)
    • Set CheckReadiness Pass (sets variable to “Pass”) by default, if an upcoming step fails, it updates
      image
    • Check Readiness – Memory
      image
    • Set CheckReadiness PHail Memory (If last step fails, it sets CheckReadiness to “Memory”
      image image
    • Check Readiness – Free Space
      image
    • Set CheckReadiness PHail Free Space (if last step fails, it sets CheckReadiness to “FreeSpace”
      image image
  • Compatibility  Scan Section (Group) – Runs if CheckReadiness = Pass
    image

    • Add Key to remove from Provisioning Mode – Creates run once key with command to remove from provisioning mode (safe guard)
      image
    • Set Start Upgrade Time
      image
    • OS Compat Scan – Upgrade Step set to Compat Scan Only
      image
    • Set Finish Upgrade Time
      image
    • Delete Key to remove from Provisioning mode
      image
  • Power Settings Restore
    • Set Power Options – Balanced (Runs if PowerPlan = Balanced)
    • Set Power Options – Power saver (Runs if PowerPlan = Power saver)
  • Set TS Finish Time
    image
  • Tweak – SetOSDInfo PS – Runs the script that writes all of the metrics to WMI & Registry
    image
  • Send Hardware Inventory
    image
  • Copy Logs to Server (if CompatScan was not successful)
    image
  • PHail Section
    • Set TS Var ReturnErrorCode” – Setup No Run – The will set the Variable ReturnErrorCode to 20 (arbitrary number that is not 0) if compatscan never ran
      image image
    • Set TS Var “ReturnErrorCode” – Setup Ran – This will set the ReturnErrorCode to the Return Code of the CompatScan
      imageimage
    • PHail if CompatScan PHailed
      image
      image

 

And there you have it, the PreCache Compat Scan TS

TS Properties: Advanced Tab: Check Box for "Suppress Task Sequence notifications"

Sorry, all of the steps are just images, but the actual TS is available for download HERE

Deployment

General: Defaults.  You might be asking, why not use the "Pre-Download Content..." option, well, that only comes into play if the deployment is "Available" vs "Required".  Since it is a required Deployment, it will start to download right away anyway.  If you're making the TS "Available" to a group for testing, it would probably be worth checking that box.

Scheduling:  We have it set to run each day @ 8PM.  Once it runs successfully we have it automatically move to the next collection, if it fails, it will just try again the next night, hopefully you've remediated anything that prevented it from running properly.  Change the schedule to fit your environment.  In my lab, this works fine, as I have collection queries move it out once it is successful. That's another blog post down the road.

User Experience... HIDDEN... we don't want the users to even know this is going on.

Distribution Points: Download all content locally before starting the task sequence.  Question: How long do we want the TS to run??  Answer: As short as possible.  Pre-Download all content also ensures that we have all of the content needed before starting.  If it can't get the content it doesn't start.  Less chance of failure during the actual TS.  Consider this, you have a remote user with little bandwidth, it will take hours for the content to download, if you didn't have it download the content ahead of time, that TS would run for hours, with a high change of the user rebooting, or turning off the machine in the middle of the TS.  Anyway, I think you get the point, download the content prior to starting the TS.

 

Example of Results (Fail Low Free Disk Space)
image

Example of Results (SUCCESS!)

image
Note, if you look at these metrics, you’ll be like… wait a minute, how was your Task Sequence run time less than the time it took to download the drivers.  Well, it downloaded the Drivers in Run 1, which then failed the Free Space Rule.  During Run 2, it had already downloaded the drivers, so it didn’t need to waste those 4 minutes again, and so the entire 2nd run only took 3 minutes.  The Script to capture this info, writes the time it took to download drivers, the 2nd time you run it, it checks that key, if it’s greater than 0, it will leave it alone, and keep the current value from the last run.

 

The Content needed for my IPU is now in my CCM Cache, which will make the IPU start instantly, no need to wait for the download. (Upgrade, Drivers & Scripts Packages)
image

If you need any clarifications on this post, please let me know and I'll try to update it.  When you work on these things every day, it's easy to miss explaining something.

Originally Posted on GARYTOWN.COM – 2018.06.05

31 thoughts on “WaaS–Post 1–PreCache Compat Scan TS

  • June 6, 2018 at 6:24 am
    Permalink

    Excellent post!
    The WaaS sessions were my favorites at MMS. I really appreciate you taking the time to write these articles explaining the details of how it's done.
    Thank you.

    Reply
  • June 6, 2018 at 12:16 pm
    Permalink

    I am starting to deploy IPU, and wanted to check the clients before deploying....So i will need some time to create a TS and test it.
    Can you please post links if you have for "Copy Logs to Server" i think i have seen it in your blog. And also currions what are the queries to move from collection to a collection.
    Do you use any reports to review the "Check Readiness TS" from the night before?
    Thank you.

    Reply
  • June 6, 2018 at 12:20 pm
    Permalink

    Sorry, i jumped the gun. Found the scripts in the zipped file.
    Thanks again.

    Reply
  • June 6, 2018 at 1:22 pm
    Permalink

    Looking at your TS i am still missing where are you passing a parameter to a "Copy-LogsToArchive.ps1" i dont see it in the script and nothing in the TS: -LogID "IPU\%SMSTS_Build%\%ComputerName%"
    Thanks,

    Reply
    • June 8, 2018 at 11:28 am
      Permalink

      Looking at the script and the parameter defaults I think it's just crossed wires.

      The %SMSTS_Build% in the Parameters field looks like it would match up with the variable %osbuildversion% being set at the start of the sequence.

      The %ComputerName% variable is simply the computer's name. So that can be assigned any number of ways ($env:ComputerName for example). Or you could use one of the native SCCM TS variables for the computer name.

      Reply
  • June 8, 2018 at 8:24 am
    Permalink

    Very helpful! cannot understand why I don't have this option as built in.

    Question? If you have bad Drivers etc as application is there a way to treat them the same way?

    Thanks

    Reply
    • July 12, 2018 at 12:38 am
      Permalink

      Hey Robert, If it's a hardblocker, they will all get caught during the Compatibility Scan, doesn't matter if Driver or App, if MS thinks it's a blocker, it will let you know.

      Reply
  • June 8, 2018 at 11:30 am
    Permalink

    Gary, this is rock solid! I'm learning a great deal going through this. I keep finding myself saying, "Why didn't I think of that?"

    Great work!

    Reply
  • June 14, 2018 at 8:52 am
    Permalink

    Hi,
    Thank you for this good post, it helps manage the upgrade process in a more streamlined manner for us.
    Just a small question, for the Dynamic variable for driver package you use
    OSDDownloadDestinationVariable to DRIVERS but when I see where the drivers are downloaded its with a folder name with random letter ex: a / f / e..
    I was hoping to download the drivers to c:\windows\CCMcache\Drivers location so I can use this location during my IPU TS.

    Is it possible to make this change in your TS? or any where in the script if so could you let me know . thanks!

    Reply
    • June 14, 2018 at 9:37 am
      Permalink

      Basically, you run the exact same group in your actual upgrade TS, so it will try to download again, (but sees it already has the content and doesn't need to download again), then creates that variable DRIVERS again, which you'd use. I'll cover that in my next post... as soon as I get time to post it.

      Reply
      • June 15, 2018 at 3:28 am
        Permalink

        Thank you for the quick response. So I will just use the DRIVERS variable under Upgrade Operating system under staged Content for Drivers during windows setup option. I think this should work.
        Thank you again.

        Reply
  • July 13, 2018 at 11:16 am
    Permalink

    Hi Gary. I have been testing the pre cache as part of our move to win 10. We are cacheing all the content but how do you get the os upgrade to use the cached copy to upgrade. Everything I have tried downloads the os package again adding 20mins to the upgrade.

    Thanks for the great blog

    Reply
    • July 13, 2018 at 11:59 am
      Permalink

      If you set the 2 TS variables at the start of your PreCache TS, it will remain on the client cache. SMSTSPersistContent & Set SMSTSPerserveContent. Then when you upgrade TS runs, as long as the content hasn't changed from the time you precached to the time you run the upgrade, it will use the upgrade content you already downloaded.

      Reply
  • July 20, 2018 at 9:55 am
    Permalink

    Hi Gary, how are you reconciling updating/servicing the WIM and having it pre-cached on a bunch of machines? I ran my compatScan a week ago, and now I have a new WIM!?!

    do you only update and do an IPU within a small time window?

    Reply
    • July 25, 2018 at 12:01 am
      Permalink

      We try to schedule a machine pretty quick after it is cached. However, if it does fall during the the period where we updated the WIM, because the deployment is set to required, it will start to cache again in the background once it receives the updated policy. Thank you for the question, I'll try to update the post soon to cover that.

      Reply
  • July 24, 2018 at 11:38 pm
    Permalink

    Hey Gary,

    Hope all is well, thanks for the excellent write up, trying to implement now. You talk about moving your devices from one collection to the next, I know you discussed this during the MMS walk on WaaS but was wondering if you or any of your cohorts have a write-up how this actually works. I'm trying to get my head around the whole process and this is obvious the first step in the larger picture.

    Also curious about the hidden task sequence as when I created the deployment and my lab machine checked policy I got notification of a change in software center and when I pulled up SC there was a new item under Operating Systems and it was downloading. Is there not a way to hide this?

    Reply
    • August 3, 2018 at 3:40 pm
      Permalink

      Paul,

      In response to your first question, I created a script that will accept a few parameters to modify the collection memberships.

      The next step was to create a status filter rule for the advertisement to run the script if it was successful.

      Here are the parameters for the status filter rule.

      General Tab
      ----------
      Source: Client
      Message ID: 11171
      Property: Advertisement ID
      Property Value:

      Actions Tab
      ----------
      Run a program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File \Set-DeviceCollections.ps1 -AddMember -AddToCollectionID "PS100ABA" -ComputerName %msgsys -RemoveFromCollectionID "PS100ABB"

      Someone else might have a better solution, but this works for me. I am also looking at using the ErrorReturnCode variable to add it to remediation collections when I need to upgrade/remove software.

      Hope this helps.

      Reply
  • July 27, 2018 at 1:21 pm
    Permalink

    New question or observation, I realized through my testing that I forgot to deploy a few driver packages and when the task sequence came up to the Set Dynamic Variables it found the correct system but when it was time to download the driver packages it failed.

    The only thing in the Registry under WaaS\1803 was "CS Started" and because the TS errored out nothing was written to WMI. Curious how you troubleshot failures on the workstations in your production environment when there is nothing to report on, or is the lack of reporting and systems still in the compatibility scan phase how you know to investigate issues.

    Reply
  • July 29, 2018 at 11:20 pm
    Permalink

    Another observation, in the CopyLogs section you reference %SMSTS_Build% but this variable has not been defined in your sequence so the script execution fails.

    You do however have Set OS Build Version in the sequence but the variable is osbuildversion.

    Reply
    • July 29, 2018 at 11:59 pm
      Permalink

      Also shouldn't the condition if the logs or copied or not be set to not equal 3247440400, assuming that value indicates a successful compat scan.

      Reply
  • August 3, 2018 at 7:40 pm
    Permalink

    Gary, you typoed one of the variables - ms docs say it's SMSTSPreserveContent - not perserve

    Reply
  • August 8, 2018 at 10:49 am
    Permalink

    Hi Gary,

    This is great information, thanks!
    I would like to know how do you prestage the OS image? I see that the steps are downloading the drivers packages, but what about the OS image & scripts/applications?

    Thanks a lot 🙂

    Reply
    • August 13, 2018 at 11:17 am
      Permalink

      This is all done by setting the two TS Variables in the beginning. Every package that is pulled down during the TS is stored in the CCMCache. So any packages referenced in the TS will be downloaded to the local cache to be available later.

      Reply
  • August 13, 2018 at 10:45 am
    Permalink

    Great post Gary! I was able to create a pre-cache task sequence that successfully downloads the OS Upgrade image, specific drivers and other packages. However, when I run my IPU task sequence it's still downloading from my DP (per logs) and not using the content in the ccmcache. Have you seen this? I have confirmed that I'm using the same package in both task sequences. Thanks for any help you can provide!

    Reply
    • August 13, 2018 at 11:13 am
      Permalink

      I've heard others say they had experienced this, but I have not. Did you confirm that the Drivers Package was downloaded into the CCMCache during PreCaching TS and that it matched the Version (no content change) when you run the steps in the IPU TS to download the drivers? I've since uploaded both my PreCache & IPU TS to my blog that you can download and see if anything pop out at you. I'm assuming you've tested running PreCache, then right after running the upgrade. Rest of the content is preserved in the CCM Cache though (Upgrade Media, Scripts, etc), just not the drivers?

      Reply
      • August 13, 2018 at 11:46 am
        Permalink

        Correct. I had confirmed all of the content was successfully downloaded to ccmcache and no content was changed from that point to running the IPU. Yep, I have tested by running the IPU right after the PreCache with the same results. I'll keep looking into it and see if I can get an answer. Thanks for the quick response!

        Reply
  • Pingback: Using SCCM Task Sequence Variables as Scripts - A Square Dozen

  • August 28, 2018 at 7:50 am
    Permalink

    Thanks for the post.
    Why cant you use "Downlooad Package Content" step in the pre-cache TS with each step based on a WMI query of the HW model and deploy the TS as mandatory with Download only the content required?

    Reply
    • September 4, 2018 at 8:06 pm
      Permalink

      If I'm following your line of thinking, that too should work, but you'd be adding a step per model you want to support vs just having a couple steps. It comes down to what works best for you.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

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