Add or Modify a Task Sequence variable (VBS)

Purpose: You need to manipulate a Task Sequence variable during an OS Deployment

So you have gotten yourself this deep into OS Deployment, well good for you! You are most likely trying to create something fancy and this article can work as a foundation on your future work with fancy-OS-deployments. You can either manipulate user given Task Sequence variables or you can create your own Task Sequence variables along the OS Deployment as you see fit.

Create a TS-variable during OSD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
' *********************************************************************************
' ** Script Name: IT_OSD_VBS_CreateTSvariable
' ** Created on: 16.12.2013
' ** Author: Jyri Lehtonen / http://it.peikkoluola.net
' **
' ** Purpose: You have information that you need to write to an AD object Attribute
' ** Usage: IT_OSD_VBS_CreateTSvariable.vbs (no parameters exist)
' **
' ** License: This program is free software: you can redistribute it and/or modify
' ** it under the terms of the GNU General Public License as published by
' ** the Free Software Foundation, either version 3 of the License, or
' ** (at your option) any later version.
' **
' ** This program is distributed in the hope that it will be useful,
' ** but WITHOUT ANY WARRANTY; without even the implied warranty of
' ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' ** GNU General Public License for more details.
' ** 
' ** History: 
' ** 1.0 / Jyri Lehtonen / 16.12.2013 / Initial version.
' *********************************************************************************
 
' The task sequence must be running for this script to work
' Create the required Object for Task Sequence manipulating
set env = CreateObject("Microsoft.SMS.TSEnvironment")
 
' Create a Task Sequence Variable
env("YOUR_TS_VARIABLE") = "YOUR_TS_VARIABLE_VALUE"
' *********************************************************************************
' ** Script Name: IT_OSD_VBS_CreateTSvariable
' ** Created on: 16.12.2013
' ** Author: Jyri Lehtonen / http://it.peikkoluola.net
' **
' ** Purpose: You have information that you need to write to an AD object Attribute
' ** Usage: IT_OSD_VBS_CreateTSvariable.vbs (no parameters exist)
' **
' ** License: This program is free software: you can redistribute it and/or modify
' ** it under the terms of the GNU General Public License as published by
' ** the Free Software Foundation, either version 3 of the License, or
' ** (at your option) any later version.
' **
' ** This program is distributed in the hope that it will be useful,
' ** but WITHOUT ANY WARRANTY; without even the implied warranty of
' ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' ** GNU General Public License for more details.
' ** 
' ** History: 
' ** 1.0 / Jyri Lehtonen / 16.12.2013 / Initial version.
' *********************************************************************************

' The task sequence must be running for this script to work
' Create the required Object for Task Sequence manipulating
set env = CreateObject("Microsoft.SMS.TSEnvironment")

' Create a Task Sequence Variable
env("YOUR_TS_VARIABLE") = "YOUR_TS_VARIABLE_VALUE"
Modify a TS-variable during OSD
1
2
3
4
5
6
' The task sequence must be running for this script to work
' Create the required Object for Task Sequence manipulating
set env = CreateObject("Microsoft.SMS.TSEnvironment")
 
' Get Task Sequence variable as a VBS variable
VARIABLE_VBS_NAME = env("TS_VARIABLE_NAME")
' The task sequence must be running for this script to work
' Create the required Object for Task Sequence manipulating
set env = CreateObject("Microsoft.SMS.TSEnvironment")

' Get Task Sequence variable as a VBS variable
VARIABLE_VBS_NAME = env("TS_VARIABLE_NAME")

Leave a Reply

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


− three = two

Post Navigation