Contoso task sequence example
| Documentation home | Development | Deployment | Compatibility | Validation |
Complete domain join and restart into full Windows
Set hidden ADGroupUserName and ADGroupPassword
Run Add-ComputerToADGroup.ps1
Clear both custom credential variables on success and failure
Handle the preserved script result
Set ADGroupUserName to CONTOSO\svc-configmgr-adgroups and enter that account’s password in ADGroupPassword through approved Task Sequence administration. Select Do not display this value for both variables. Do not put the password in a command line or package.
Use the extracted Scripts folder as the package source and set Script name
to Add-ComputerToADGroup.ps1. Run as Local System using Windows PowerShell 5.1
with these Run PowerShell Script parameters:
-GroupName 'Workstation-Certificate-AutoEnroll'
The default is Kerberos over LDAPS TCP 636; the group name is a sAMAccountName. This example is a deployment pattern, not a recorded live test. See deployment for permissions, logging, and cleanup handling, and compatibility for separate opt-in examples.