Michael Wu

The Life of a Cloud Engineer

  • Home
  • Resume
  • Blog
  • Contact

Posted on 08.09.16

Add Custom Task Sequence Variables and Read them in PowerShell

Custom Task Sequence (TS) Variable is useful when we have different Images deployments. We can setup the variable to control what application or software should be deployed by reading those variables. PowerShell MVP Stéphane van Gulick provides the awesome OSD tattoo script to manipulate task sequence variables. It can read TS variables and write them into Registry, WMI and Environment variables. I will demonstrate how I use OSD Tatto script to add custom TS variable.

First, I create two Task Sequence Variables in the Task Sequence.

TS1

TS2

Then, add the PowerShell script and the Parameters.

TS3_1

 

The New-OSDTattoo.ps1 will need to be updated in order to read and write the custom TS variables that we created.

Add two custom lines under the PSDistrict_ variables in the main script region . It locates at about line 911 in the script.

TS5 After deployed the task sequence to the test computer, we can see the variables are written into the Registry.

TS4_censored

Categories:PowerShell, SCCM

Recent Posts

  • Automating Resource Restriction in Azure subscriptions with Budget Alert, Automation Account, and Azure Policy
  • How to configure the Security Center via Azure Resource Manager (ARM) template
  • How to restrict Account Operators to see the password in LAPS
  • How to join a VM to a domain by PowerShell in Azure
  • How to push an existing repository from VS Code to Azure DevOps by PowerShell

Search

Categories

  • Azure
  • IIS
  • PowerShell
  • SCCM
  • VMware
  • Windows Server

Contact

Email: [email protected] | Powered By the 太初網路

Copyright © 2024 mikewu.org Disclaimer

Connect

FacebookTwitterGoogle +Linkedin