PSD icon indicating copy to clipboard operation
PSD copied to clipboard

Parsing CustomSettings.ini before TS execution

Open RB14060 opened this issue 10 months ago • 6 comments

Under traditional MDT, I use a modification to the DeployWiz_SelectTS.vbs file that allows it to re-parse CustomSettings.ini before the TS kicks off. I use this to fill in the task sequence name in the progress banner, as well as dynamically set the computer name based off of the device's serial number. I've made the same CS.ini changes in my PSD share, but am unsure of what I would need to change to get this working. If anyone knows how to do this or if there's some native way to do this that I'm overlooking, it would be greatly appreciated.

RB14060 avatar Apr 08 '24 04:04 RB14060

That is a custom plugin for MDT right? I don't fully understand the script's capabilities but keep in mind VBScript are not used in the PSD, all of that is now replaced with ps1. I also don't believe this feature is a native function in PSD either but I have a couple of options you can try:

  • The new PSD Wizard does support the ability to name a device with serial number. Read the section for supported-variables-in-customsettingini

  • The naming of the progress banner, I believe, is controlled by the _SMSTSOrgName and _SMSTSPackageName properties, right? You can control that dynamically using the Priority option in cs.ini which then sets different "prefix"

As a simple example:

In my cutomsettings.ini, I set:

image

Then I get: image

This is how I can control it dynamically but not sure what your Priority's would be based on to set the appropriate prefix...network or gateway perhaps? Is this what your looking for?

PowerShellCrack avatar Apr 08 '24 18:04 PowerShellCrack

It's not so much a custom module, as it is changing a couple lines in the file that I mentioned to make it rerun a gather before the TS kicks off. It executes on clicking the "Next" before it actually starts the process. I moved my OSDComputerName to my Default section since it is actually the same across all deployments, so there's no problem with me moving it there.

I have my _SMSTSPackageName set to %TaskSequenceName% on %OSDComputerName%, which properly pulls the computer name, but does not show the TS name. Not a huge deal and I can just remove the TS name and be fine with that. Appreciate the insight.

RB14060 avatar Apr 10 '24 21:04 RB14060

%TaskSequenceID% works if that helps.

JerichoJones avatar Apr 11 '24 15:04 JerichoJones

I have my _SMSTSPackageName set to %TaskSequenceName% on %OSDComputerName%, which properly pulls the computer name, but does not show the TS name. Not a huge deal and I can just remove the TS name and be fine with that. Appreciate the insight.

To be honest I got a bit confused here, if the _SMSTSPackageName=%TaskSequenceName% then what is set for %OSDComputerName%? Because the way you phrased it is a bit confusing.

Also, as @PowerShellCrack mentioned, the PSD works differently than MDT, the first part is that it uses only PowerShell for the script/Wizard instead of VBScript. The second is that the solution is not a 100% replica of MDT, some things work differently some others don't or not yet implemented. Moreover the focus of the solution is to provide a secure way of imaging devices from anywhere, hence the IIS and certificates requirement and the move away from SMB for the file transfers. Something that I frequently stress here, is that before anyone tries the solution, they should consult the documentation and determine if they want to invest the time required to switch to it.

GeoSimos avatar Apr 11 '24 19:04 GeoSimos

To be honest I got a bit confused here, if the _SMSTSPackageName=%TaskSequenceName% then what is set for %OSDComputerName%? Because the way you phrased it is a bit confusing.

It's literally how I have the option phrased. It translates to "Running Clinical Configuration on SYM-12345". Quick easy way for me to see the TS I selected and make sure the PC auto-named properly.

RB14060 avatar Apr 11 '24 19:04 RB14060

To be honest I got a bit confused here, if the _SMSTSPackageName=%TaskSequenceName% then what is set for %OSDComputerName%? Because the way you phrased it is a bit confusing.

It's literally how I have the option phrased. It translates to "Running Clinical Configuration on SYM-12345". Quick easy way for me to see the TS I selected and make sure the PC auto-named properly.

Ah OK, now I got it! Thanks! Sometimes it helps to have an example ;-)

GeoSimos avatar Apr 11 '24 19:04 GeoSimos