Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing CustomSettings.ini before TS execution #144

Open
RB14060 opened this issue Apr 8, 2024 · 6 comments
Open

Parsing CustomSettings.ini before TS execution #144

RB14060 opened this issue Apr 8, 2024 · 6 comments

Comments

@RB14060
Copy link

RB14060 commented Apr 8, 2024

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.

@PowerShellCrack
Copy link
Contributor

PowerShellCrack commented Apr 8, 2024

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?

@RB14060
Copy link
Author

RB14060 commented Apr 10, 2024

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.

@JerichoJones
Copy link

%TaskSequenceID% works if that helps.

@GeoSimos
Copy link
Collaborator

GeoSimos commented Apr 11, 2024

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.

@RB14060
Copy link
Author

RB14060 commented Apr 11, 2024

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.

@GeoSimos
Copy link
Collaborator

GeoSimos commented Apr 11, 2024

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 ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants