Searching the web didn't came up with any results, and since the request sounded really reasonable to me, I decided to take the challenge.
My solution had to be secure. meaning, password cannot be written in clear text or any other non-secure method in any way.
After a lot of research I came up with the following steps to complete this request:
- Enable PowerShell in boot images.
- Create a package that copy's Active Directory module files to the boot image, and run it in task sequence.
- Create a PowerShell script that do the following:
- Interact with task sequence.
- load PowerShell form for prompting computer name selection.
- Import Active Directory module, securely connect to Active Directory and check the name against Active Directory.
- Set computer name as OSDComputername TS variable (assuming that the name not exists).