Support is >Here<

MDT Imaging Support Expert Advice

RSS
Facebook
Twitter

Look who's giving Logan the cuddles.

How to use VBScript in your MDT/SCCM CustomSettings.INI.

The built-in CustomSettings.INI variables are very useful, but in some occassions they are simply not enough. For instance, the “Model” variable contains the FULL model number (ie. CF-19K4RAX2M). What if I want to create a section breakout for all CF-19 laptops? Here is a method I found to perform this task:
1. First you must tell your “ZTIGather..” script to look out for a new variable, which is ShortModel in my example. Add a line to the “<DeploymentShare>\Scripts\ZTIGather.XML” file, which is read by the ZTIGather.wsf prior to combing your CS.INI matching variables.

<property id=”ShortModel” type=”string” overwrite=”true” description=”Short Model Number” />

2. Next add the following lines to your CS.INI:

;Tells ZTIGather to look in the “RunFirst” section first,
; which will populate the ShortModel variable, which in
; turn be replaced when searching for the “ShortModel”
; section.
Priority=RunFirst, ShortModel, Default

[RunFirst]
;Example output will be CF-19 instead of CF-19K4RAX2M
ShortModel=# LEFT( oEnvironment.Item(“Model”),5 ) #

;Now I can add my CF-19 section
[CF-19]

Another very useful easy CS.INI code block I use to add VBScript and more intelligence to my CS.INI. Is a custom Variable, which contains a specialized formatted Date to my liking. I can use this variable wherever I like and whenever I like throughout my ENTIRE Deployment (TS included).
1. Just as I did before I add the variable to my “ZTIGather.XML” file to tell my ZTIGather.wsf to look out for the variable in my CS.INI.

<property id=”SpecialDate” type=”string” overwrite=”true” description=”Special Date Value” />

2. Then I populate it wherever I like in my CS.INI

SpecialDate=#DatePart("M",Now) & DatePart("D",Now) & DatePart("YYYY",Now)#

-Brian G

Share

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Best Completely free

  http://www.tweaknow.com/BestFreeApps.php I agreed with all of the applications listed in this ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

2 simple vbs scripts

Just two simple scripts I wrote up to disable number ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

Creating Simple and/

Using the Wizard Editor is fairly self explanatory for adding ...

How to use VBScript

The built-in CustomSettings.INI variables are very useful, but in some ...

Sponsors

  • Elegant Wordpress Themes.
  • Flexithemes.
  • Code Canyon.
  • ThemeForest.