Collect OSD / IPU Info with Hardware Inventory

Update 2018.08.01 To include Hard  Blocker from  Compat Scan, requires you to add a step into the TS to capture the Hard  Blocker to a  TS Variable,  Blog Post HERE

Update 2018.06.05 - I've posted the first WaaS Post, which incorporates this Script into a Compatibility Scan Task Sequence.  I've updated the script since this post, which is available to download, along with the Task Sequence Export in this POST HERE

Several years ago I started to use Jason Sandys’ OSDInfo Script.  I liked the idea of having a script run during OSD that would write information to WMI, which made it easy to inventory.  Now I do IPU (In Place Upgrade) so much more than OSD, and I wanted to do the same, gather important information from IPU and be able to use it for Reporting or creating collection queries.

I’ve taken Jason’s script and modified it… a lot.  All of his plumbing is still in place (functionality to add information to WMI & Registry), but I’ve added a lot of logic around using the script for different functions.

The script is now broken into 3 sections, OSD (Operating System Deployment), CS (Compatibility Scan), IPU (In Place Upgrade).  Using TS Variables, the script will run different sections of the script.  This allows me to use the same script in numerous scenarios.
First, I’ll show you results, and then go into details about how it’s done.  But I feel it’s easier to understand the script and process if you can see the end product.

Registry, Creates WaaS Key, then subkeys for OSD and IPU Build Numbers to keep thing separated for historical data.  If you’re a Reg2Mof person, this is probably the way you’ll want to go.

OSD Info:
image

CS & IPU:
CompatScan = Green
IPU = Yellow
Both Processes = Blue (IPU overwrites CS info)

image

WMI: (Makes it easy to import into Hardware Inventory, but the data is spread out a bit instead of in one nice view)
Classes: CompatScan / IPU / OSD
Instances: Build Number
Prosperities: Details from each process

image

SQL: (When using WMI & Hardware Inventory)

OSD:
image
CompatScan:
image
IPU:
image

Used for Report:
image

 

Ok, now to the “How” section, the Script:
Requires Several TS Variables to function, will cover after script.

Step in Task Sequences
Required Variables in TS:
SetOSDInfoType: Set to OSD / CS / IPU - Tells the Script which section to run.

I set the osdbuildversion variable in the beginning of the TS, which gets used in the script & command line.

image

SMSTS_StartTSTime - Records time at the very start of the TS

SMSTS_FinishTSTime - Records time near the end of the TS, used in the script to calculate run time of TS

CheckReadinessResult: If Check Readiness Fails, Set to FAIL

SMSTS_StartUpgradeTime - Records time right before Upgrade Step Starts.

SMSTS_FinishUpgradeTime - Records time right after Upgrade Step finishes, to calculate upgrade time

SMSTS_DMDepartment - Collection Variable - Specific to my Test Lab to help track which Department a computer belongs to
SMSTS_DMLocation - Collection Variable - Specific to my Test Lab to help track which Branch computer belongs to
- These are just for sample to show you can collect information like this during IPU / OSD.  Recommend Customization them for your environment or removing them from the script.

 

OSD: Run Powershell Script:

image

CompatScan: Run PowerShell Script

image

IPU: Run PowerShell Script:

image

 

Add to Hardware Inventory: Set Classes –> Add –> Connect –> Computer Name of machine you ran the script on and you confirmed the WMI NameSpace and values are created –> Ensure you change the namespace to the namespace you specified in the TS-> Connect
image

Check the Boxes and click OK: (I’ve already done this, which is why they say “exists” in this screen capture, and the class names are greyed out, but when you do it the first time, you’ll be able to check those boxes)
image

You can then verify all the fields then and check the ones you want. If you change the script in the future, you’ll need to come back in here and modify what you’ve checked.
OSD:
image
CompatScan:
image

IPU:
image

Used in Collection Queries:

 

And now, as machines run through your process, and hardware inventory is collected, you’ll have useful data to provide.

If you have any questions, let me know.  I've been running this so long, that I might have missed a step I needed to set it all up originally.

Published originally on garytown.com

4 thoughts on “Collect OSD / IPU Info with Hardware Inventory

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.