This is playing off my last post, I was debating having it all in one post, but landed on making two. I get paid per post, so why not?
In this post, I’m going to show how easy it can be to gather user input into a Task Sequence variable, stealing 99% of the code from Microsoft Learn.
Creating a custom input box – PowerShell | Microsoft Learn
This is getting you the same results, allowing you to get user input in string form, then placing that into a TS Variable, it just looks a little nicer.
GitHub Script: garytown/OSD/UserInputDialog.ps1
Here you can see the script running in the Task Sequence. It prompts for user data, and places it into a TS Variable.
In Action
I’ve split up the thing you’d probably want to configure into 3 variables, and you can also change the icon by swapping out the base64 icon data.
Alight, so while I don’t know of when you’d need to use this, at least you can and with style.
GARYTOWN.COM
how to pass user input like country code–example US, and Desktop -D, set computer name based on country code, desktop + serial number UKD1234567
how to join to UK Desktop OU
I would use a front end to set all that.
I’d recommend using UI++ https://uiplusplus.configmgrftw.com/
https://github.com/recast-software/ConfigMgr-Docs/blob/main/Community-Tools/Community-Tools-UI%2B%2B.md
You can query the device to set the D or L for Desktop or Laptop automatically, as well as find the serial number.