Hi,
Thanks for posting in Microsoft Q&A forum.
1,You can refer to below article to use a script to secure the process.
Joining the Domain with a Script
Note: The non-Microsoft link is just for your reference.
2,You can also try to use the combination of service account for joining domain + specifying service account credentials in MDT database where it's encrypted.
Hope it helps. Thanks for your time.
Best regards,
Simon
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.