If you want to know how to read and write custom variables in a SCCM task sequence then you will want to read this. (Part 1 of 2)

I’ve been looking for a method of reading and writing custom variables from within a task sequence as I will shortly be writing a Powershell GUI front-end for our imaging task and being able to do this step is an essential pre-requisite to achieving my end goal.

I used three Microsoft articles in my research on how to do this:

  1. About Task Sequence Variables
  2. Task Sequence Built-In Variables
  3. Prestart commands for task sequence media

I thought I would try a ‘real-world’ example – something that may have some real value in the workplace – while I tried to figure out how all of this worked. I decided to use the tried and tested “Hello World!” SCCM equivalent of logging the following information into the computers registry once imaging was complete :

  • Date image started
  • Image Start time
  • Image End Time
  • Total time taken to image
  • Task sequence used to image
  • Name of image used

Here is a screenshot of the final result taken from the registry of an imaged computer:

1-1

Part 2 explains how I went about achieving this.


Get my books:

ConfigMgr - An Administrator’s Guide to Deploying Applications using PowerShell


“Understanding Microsoft Intune: Deploying Applications Using PowerShell” is available for purchase at all good book stores and online outlets. Don’t miss out on the opportunity to take your application deployment skills to the next level. Get your copy today!

Amazon.co.uk

Amazon.com

Apress